Note that there are some explanatory texts on larger screens.

plurals
  1. PORuntime error creating intent
    text
    copied!<p>I am trying to create a test app for a library I am creating. When my library is called, it creates an intent and starts an activity.</p> <pre><code>intent = new Intent(getApplicationContext(), video_on_load.class); myLib.this.startActivity(intent); </code></pre> <p>My program it seems my program is crashing on creating the new Intent. I tried to why this would happen, and I saw that in my app I have to had the activity to the AndroidManafest, so I added the following line to my manifest:</p> <pre><code>activity android:name="com.example.myLib.video_on_load"&gt;&lt;/activity&gt; </code></pre> <p>However my app is still crashing with the message "Unfortunately, TestApp has stopped." I am unsure how to continue. I am fairly new to android programming, so it may be something simple I missed. Let me know if you need any other information that would be useful in debugging this problem.</p> <p>My video_on_load class is as follows:</p> <pre><code>public class video_on_load extends Activity { private RelativeLayout layout; private ProgressBar progressBar; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.video_on_load); layout = (RelativeLayout) findViewById(R.id.video_onLoad_layout); progressBar = (ProgressBar) findViewById(R.id.video_onLoad_progress); } </code></pre> <p>Edit:</p> <p>Relevent LogCat:</p> <pre><code> 12-28 17:53:23.824: E/AndroidRuntime(25042): java.lang.NullPointerException 12-28 17:53:23.824: E/AndroidRuntime(25042): at android.content.ContextWrapper.getPackageName(ContextWrapper.java:135) 12-28 17:53:23.824: E/AndroidRuntime(25042): at android.content.ComponentName.&lt;init&gt;(ComponentName.java:75) 12-28 17:53:23.824: E/AndroidRuntime(25042): at android.content.Intent.&lt;init&gt;(Intent.java:3491) </code></pre> <p>video_on_load.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/video_onLoad_layout" &gt; &lt;ProgressBar android:id="@+id/video_onLoad_progress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" style="@android:style/Widget.ProgressBar.Large" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>Thank you</p>
 

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