Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid startActivity Nullpointer exception
    primarykey
    data
    text
    <p>hi the function startActivity throws a nullpointer exception this is my class:</p> <pre><code>public class DetailActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); } public void showHtml(String prod){ Intent myIntent = new Intent(getBaseContext(), DetailActivity.class); startActivity(myIntent); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. //getMenuInflater().inflate(R.menu.activity_main, menu); return false; } } </code></pre> <p>and this is my manifest</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.xxxx" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-permission android:name="android.permission.CAMERA"/&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-sdk android:minSdkVersion="11" android:targetSdkVersion="16" /&gt; &lt;application android:theme="@android:style/Theme.NoTitleBar" android:allowBackup="false"&gt; &lt;activity android:name="com.example.xxxx.MainActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="com.example.xxxx.fragments.frag1.BarcodeInsertActivity" /&gt; &lt;activity android:name="com.example.xxxx.fragments.frag2.ShopBasketActivity" /&gt; &lt;activity android:name="com.example.xxxx.fragments.frag3.CheckoutActivity" /&gt; &lt;activity android:name="com.example.xxxx.fragments.frag4.DetailActivity" /&gt; &lt;activity android:name="com.google.zxing.client.android.CaptureActivity" android:configChanges="orientation|keyboardHidden" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:label="ZXing" android:windowSoftInputMode="stateAlwaysHidden" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;intent-filter&gt; &lt;action android:name="com.google.zxing.client.android.SCAN" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>this is how i try to execute the function</p> <pre><code> DetailActivity gg= new DetailActivity(); gg.showHtml( "some html code &lt;div class='someclass'&gt;asdas&lt;/div&gt; and other html tags"); </code></pre> <p>would be nice if some could help me tried a lot of things nothing worked :)</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.
    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