問題タブ [activitynotfoundexception]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - Nougat Android 7 を使用して IccLockSettings を呼び出すと、ActivityNotFoundException がスローされる
SIM PIN 設定を開くために、Android M 7.0 SDK 24 までこのコードを使用しています。Sim はトレイの中にあります。^^
Android N では、android.content.ActivityNotFoundException を取得しています。
どんな手掛かり ?
android - try/catch ブロックがある場合でも、null オブジェクト参照で「boolean android.content.Intent.migrateExtraStreamToClipData()」でアプリがクラッシュする
パッケージ名を使用して特定のアプリを開こうとしています。そのために、次のコードを使用しています。
携帯電話にインストールされているアプリを開こうとすると正常に動作しますが、携帯電話にないアプリを開こうとすると、アプリがクラッシュして次のエラーが発生します。
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Intent.migrateExtraStreamToClipData()' on a null object reference
ライン上
startActivity(intent);
ご覧のとおり、try/catchそこにブロックがあるのに、なぜ例外が追いつかず、代わりにコードが実行されてクラッシュするのでしょうか?