Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:1555656****"));
intent.putExtra("sms_body", "編輯短信内容 !!");
startActivity(intent);
這段代碼簡單明了,需要用到的朋友一試便知。号碼跟内容就不用備注了.
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.******.com"));
startActivity(intent);
//浏覽器也是這麼簡單,一個網址搞定,就不多講了,玩這個的人講究的是實用
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:187*****750"));
intent.addCategory(Intent.CATEGORY_DEFAULT);
startActivity(intent);
從此打電話也不再是難題
Intent intent = new Intent();
intent.setAction("android.intent.action.CALL_BUTTON");
startActivity(intent);
此代碼一樣可以打電話,就是無法把号碼傳過去
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.chengxl.demo",
"com.chengxl.demo.IntentDemo"));
intent.putExtra("str", "大米");
startActivity(intent);
跳轉到自己的程式,兩個參數,前一個是包名,後一個是主activity的名。加個一個資訊來知道是跳轉了。