I'd like to know what is the format for an android intent. IE, what should I pass to the method :
getBaseContext().startService(Int开发者_如何学Cent);
If I want to pass this:
android.provider.CallLog.Calls.CONTENT_URI
can i? What would be the format.
Can someone give a good explanation of how to use Intents, and how to use it on Service implementation, like, startService()
, or onStartCommand (Intent intent, int flags, int startId)
.
Thanks!
Just to call a new Activity this is the method.
startActivity(new Intent(this, MYACtivityClass.class));
If you want to pass values into the Activity, you need to create a Bundle
Intent a = new Intent(this, MYACtivityClass.class); Bundle b = new Bundle(); b.putBoolean("test", true); a.putExtra("myBundle", b); startActivity(a);
精彩评论