2010-09-14 28 views
0

我已經在android中編寫了一個簡單的程序來顯示通知。點擊通知msg我必須轉到收件箱。我正在使用下面的代碼。轉到安卓中的收件箱

Intent notifyIntent = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse("content://sms/inbox")); 
PendingIntent intent = PendingIntent.getActivity(SimpleNotification.this, 0, 
        notifyIntent, android.content.Intent.FLAG_ACTIVITY_NEW_TASK); 

我能夠收到通知,但通過點擊通知我不能夠去的收件匣。

請提前

+0

可能重複[訪問Android的收件箱中活動/消息?(http://stackoverflow.com/questions/3260471/accessing-android-inbox-messaging-from-activity) – 2010-09-14 13:27:29

回答

0

任何help..thanks根據答案this question ,以下將啓動消息應用程序。但是,這會使用不屬於Android內核的未公開API。開發人員不應該使用com.android.mms應用程序,因爲它不能保證在未來的版本或所有設備上工作。

Intent intent = new Intent("android.intent.action.MAIN"); 
intent.setComponent(
    new ComponentName("com.android.mms","com.android.mms.ui.ConversationList")); 
startActivity(intent); 
+0

這將無法正常工作的有些設備可能無法在未來的Android版本中使用。 'com.android.mms'應用程序和'content:// sms/inbox'內容提供者都不應該被開發者使用,因爲它們都不是操作系統的一部分。 – CommonsWare 2010-09-14 14:02:25

+0

謝謝,我已經用警告更新了我的答案。 – Brian 2010-09-14 14:30:24

+0

謝謝..我會檢查出來。 – 2010-09-14 17:22:50