How to start activity when user clicks a notification?

后端 未结 6 1235
梦如初夏
梦如初夏 2020-12-05 11:18

I am attempting to convert some code I found in a tutorial for my own use. Originally, the code launched the system contacts list when the user would click a notification ge

6条回答
  •  被撕碎了的回忆
    2020-12-05 11:44

    Can you try removing the Intent filter, so it looks like this:

    
    

    Also, not sure if this code will work:

    ourClass = Class.forName("com.kjdv.gpsVegas.ViewTarget"); Intent startMyActivity = new Intent(context, ourClass);

    Can you try it like this instead:

    Intent startMyActivity = new Intent(context, ViewTarget.class);

提交回复
热议问题