2011-10-04 37 views
0

我希望我的應用程序的用戶能夠在市場上撰寫評論。我想與Android市場place.I在嘗試這種方式來銜接我的應用程序,但我得到的錯誤如何使用應用程序撰寫有關Android市場的評論?

代碼

Uri marketUri = Uri.parse("market://details?id=" + getPackageName()); 
Intent intent = new Intent(Intent.ACTION_VIEW, marketUri); 
startActivity(intent); 

和錯誤,如

10-04 16:24:15.017: ERROR/AndroidRuntime(661): FATAL EXCEPTION: main 
10-04 16:24:15.017: ERROR/AndroidRuntime(661): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=com.stress } 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1409) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at android.app.Activity.startActivityFromChild(Activity.java:3067) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at android.app.Activity.startActivityForResult(Activity.java:2847) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at android.app.Activity.startActivity(Activity.java:2933) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at com.stress.More$1.onItemClick(More.java:63) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at android.widget.AdapterView.performItemClick(AdapterView.java:284) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at android.widget.ListView.performItemClick(ListView.java:3513) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at android.widget.AbsListView$PerformClick.run(AbsListView.java:1812) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at android.os.Handler.handleCallback(Handler.java:587) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at android.os.Handler.dispatchMessage(Handler.java:92) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at android.os.Looper.loop(Looper.java:123) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at android.app.ActivityThread.main(ActivityThread.java:3683) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at java.lang.reflect.Method.invokeNative(Native Method) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at java.lang.reflect.Method.invoke(Method.java:507) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
10-04 16:24:15.017: ERROR/AndroidRuntime(661):  at dalvik.system.NativeStart.main(Native Method) 
+0

你在模擬器上運行這個嗎? – jamapag

+0

你需要在真實的設備上進行測試 – PedroAGSantos

回答

0

如果您是從調用此不同的類,然後檢查你的清單,如果你已經提到該活動名稱或不。如果您忘記提到Manifest文件中的某些類並嘗試訪問它,則會發生ActivityNotFoundException。

試試這個代碼太例如:

Intent marketLaunch = new Intent(Intent.ACTION_VIEW); 
marketLaunch.setData(Uri.parse("YOUR APP'S ANDROID MARKET LINK HERE")); 
startActivity(marketLaunch); 
0

你可能想看看這個鏈接(Open Source Android Market API) - 沒有做你現在想要什麼,但可能在未來即具有整合市場的功能(儘管基於網絡的後端)到您的應用程序

相關問題