How to start Activity from Android AppWidget?

后端 未结 3 1278
眼角桃花
眼角桃花 2021-01-11 13:48

Code like this works well.

    Intent configIntent = new Intent (context, WidgetConfigActivity.class);
    configIntent.putExtra(AppWidgetManager.EXTRA_APPWI         


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-11 14:26

       // on receive function use this for new activity start
                   Intent intent = new Intent (context, AppWdget.class);
                   intent.setFlags (Intent.FLAG_ACTIVITY_NEW_TASK);
                   context.startActivity (intent);
    

提交回复
热议问题