這適用於模擬器,但安裝在設備上時會導致應用程序崩潰。Android應用程序在執行通知代碼時崩潰
String frndName=getSharedData("myOnlineFriendName");
Intent intent = new Intent(this, MainActivity.class);
PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent, 0);
Notification noti = new Notification.Builder(this)
.setContentTitle("Trace Me! Notification")
.setContentText(frndName+"'s New Location:")
.setSmallIcon(R.drawable.ic_launcher)
.setContentIntent(pIntent)
.addAction(R.drawable.ic_launcher, "And more", pIntent).build();
NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
playSound("n");
noti.flags |= Notification.FLAG_AUTO_CANCEL;
notificationManager.notify(0, noti);
我該如何解決這個問題?
logcat的: -
03-26 05:29:33.387: E/WVMExtractor(39): Failed to open libwvm.so
03-26 05:29:33.837: E/WVMExtractor(39): Failed to open libwvm.so
03-26 05:29:34.147: E/WVMExtractor(39): Failed to open libwvm.so
03-26 05:29:34.467: E/WVMExtractor(39): Failed to open libwvm.so
03-26 05:29:34.807: E/WVMExtractor(39): Failed to open libwvm.so
03-26 05:29:35.067: E/WVMExtractor(39): Failed to open libwvm.so
03-26 05:29:35.227: E/WVMExtractor(39): Failed to open libwvm.so
03-26 05:29:35.417: E/WVMExtractor(39): Failed to open libwvm.so
03-26 05:29:35.537: E/WVMExtractor(39): Failed to open libwvm.so
03-26 05:29:35.657: E/WVMExtractor(39): Failed to open libwvm.so
03-26 05:29:42.127: E/SurfaceFlinger(36): ro.sf.lcd_density must be defined as a build property
03-26 05:29:42.157: E/MapActivity(1016): Couldn't get connection factory client
03-26 05:29:42.697: E/WVMExtractor(39): Failed to open libwvm.so
請分享logcat的 – onkar 2013-03-26 04:54:15
告訴我們你的錯誤.. – 2013-03-26 05:18:34
與Emulator一起工作良好,並且沒有錯誤存在,但是在Real設備上,「Applica重刑已停止工作不幸的是「 – 2013-03-26 05:21:14