2016-03-08 59 views
1

我需要處理程序,它至少捕獲小部件的位置。有沒有這樣的事情?我試過onAppWidgetOptionsChanged(),但沒有按我的需要工作。 請幫忙。謝謝。如何在android中捕獲小部件位置

+0

請在此處添加代碼什麼妳代碼完全做到。 @robineki –

回答

0
@Override 
public void onAppWidgetOptionsChanged(Context context, AppWidgetManager appWidgetManager, int appWidgetId, Bundle newOptions) { 
    super.onAppWidgetOptionsChanged(context, appWidgetManager, appWidgetId, newOptions); 
    try { 
      //open selection 
      Intent intn = new Intent (context, DialogSelect.class); 
      intn.setFlags (Intent.FLAG_ACTIVITY_NEW_TASK); 
      context.startActivity(intn); 
    } catch (Exception e) {Toast.makeText(context, e.getMessage(), Toast.LENGTH_LONG).show();} 
    updateAppWidget(context, appWidgetManager, appWidgetId); 
} 

覆蓋方法不工作

相關問題