Start activity by clicking on widget

前端 未结 3 2086
梦如初夏
梦如初夏 2020-12-15 18:18

I newbie at programming Android and I try to do a widget which has be able get some data from ISP about my account. There are a lot of unknown things how to do it, but I hav

3条回答
  •  长情又很酷
    2020-12-15 18:37

    Intent inet = new Intent(your_action);
    inet.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    PendingIntent pIntentNetworkInfo = PendingIntent.getActivity(context, 2, 
                inet, Intent.FLAG_ACTIVITY_NEW_TASK);
    remoteViews.setOnClickPendingIntent(you_component_when_the_user_pressing_this_activity_should_start, pIntentNetworkInfo);
    

提交回复
热议问题