你出现ActivityNotFoundException错误是因为Zxing应用没有在你的设备上安装所以,请检查是否安装如果没有,可以将你的用户重定向到Goolge Play的Zxing页下面这些代码可以帮你: boolean isZxingInstalled; / Checking whether Zxing is installed or not / try { ApplicationInfo info = getPackageManager()getApplicationInfo("comgooglezxingclientandroid", 0 ); boolean isZxingInstalled = true; } catch(PackageManagerNameNotFoundException e){ isZxingInstalled=false; } / Store the boolean value on the basis of Zxing is installed or not / if(isZxingInstalled) //If it is then intent Zxing application { //start the facebook app Intent intent = new Intent("comgooglezxingclientandroidSCAN"); intentsetPackage("comgooglezxingclientandroid"); intentputExtra("SCAN_MODE", "PRODUCT_MODE"); intentputExtra("SCAN_FORMATS", "CODE_三9,CODE_9三,CODE_依贰吧,DATA_MATRIX,ITF,CODABAR,EAN_依三,EAN_吧,UPC_A,QR_CODE"); startActivityForResult(intent, 0); } else //It's not then redirect user to PlayStore-ZxingPlage { / Checking whether PlayStore is installed in device or not / boolean isPlayStoreInstalled try { ApplicationInfo i=getPackageManager()getApplicationInfo("comgooglevending", 0 ); boolean isPlayStoreInstalled = true; } catch(PackageManagerNameNotFoundException e){ isPlayStoreInstalled=false; } / If it is the download Zxing / if(isPlayStoreInstalled) { Intent DownloadZxing = new Intent(IntentACTION_VIEW,Uriparse("market://detailsid=comgooglezxingclientandroid")); startActivity(DownloadZxing); } else //Toast message indicating No PlayStore Found { ToastmakeText(this,"Install PlayStore First",ToastLENGHT_SHORT)show(); }
>
1 使用浏览器浏览网页
//web浏览器
Uri uri= Uriparse(">
以上就是关于android的界面切换问题全部的内容,包括:android的界面切换问题、如何屏蔽toast提示、android ACTION_SENDTO是什么意思等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)