Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid-list of installed media players
    primarykey
    data
    text
    <p>I know that this post is like this question : <a href="https://stackoverflow.com/questions/4586684/how-to-get-a-list-of-installed-media-players">How to get a list of installed media players</a> but i tried to test the code and it crashes ! this is the code :</p> <pre><code>public class Newactivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.display); Intent intent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.withAppendedPath(MediaStore.Video.Media.INTERNAL_CONTENT_URI,"1"); intent.setData(uri); List&lt;ResolveInfo&gt; playerList; PackageManager packageManager = null; playerList = packageManager.queryIntentActivities(intent, 0); } </code></pre> <p>this is logcat errors:</p> <pre><code>10-19 13:05:52.770: E/AndroidRuntime(558): FATAL EXCEPTION: main 10-19 13:05:52.770: E/AndroidRuntime(558): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.upnpexample/com.upnpexample.Newactivity}: java.lang.NullPointerException 10-19 13:05:52.770: E/AndroidRuntime(558): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 10-19 13:05:52.770: E/AndroidRuntime(558): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 10-19 13:05:52.770: E/AndroidRuntime(558): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 10-19 13:05:52.770: E/AndroidRuntime(558): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 10-19 13:05:52.770: E/AndroidRuntime(558): at android.os.Handler.dispatchMessage(Handler.java:99) 10-19 13:05:52.770: E/AndroidRuntime(558): at android.os.Looper.loop(Looper.java:123) 10-19 13:05:52.770: E/AndroidRuntime(558): at android.app.ActivityThread.main(ActivityThread.java:3683) 10-19 13:05:52.770: E/AndroidRuntime(558): at java.lang.reflect.Method.invokeNative(Native Method) 10-19 13:05:52.770: E/AndroidRuntime(558): at java.lang.reflect.Method.invoke(Method.java:507) 10-19 13:05:52.770: E/AndroidRuntime(558): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 10-19 13:05:52.770: E/AndroidRuntime(558): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 10-19 13:05:52.770: E/AndroidRuntime(558): at dalvik.system.NativeStart.main(Native Method) 10-19 13:05:52.770: E/AndroidRuntime(558): Caused by: java.lang.NullPointerException 10-19 13:05:52.770: E/AndroidRuntime(558): at com.upnpexample.Newactivity.onCreate(Newactivity.java:31) 10-19 13:05:52.770: E/AndroidRuntime(558): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 10-19 13:05:52.770: E/AndroidRuntime(558): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 10-19 13:05:52.770: E/AndroidRuntime(558): ... 11 more </code></pre> <p>any idea please ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload