Note that there are some explanatory texts on larger screens.

plurals
  1. POApp fails to lauch, logcat says line 29 which seems to be okay
    text
    copied!<p>Here is the code, line 29 corresponds to the the bextras button config, and it seems right. Line 29 - extras.setTypeface(font3); When I delete it and launch the app, it goes to the extras.setOnClickListener and display an error there, the app works fine when I remove the whole extra button and its props, including the setOnClickListener.</p> <p>Whats wrong?</p> <pre><code>public class TheBeginning extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_the_beginning); Button gogym = (Button) findViewById(R.id.bgym); Typeface font = Typeface.createFromAsset(getAssets(), "Sanvito.ttf"); gogym.setTypeface(font); Button gofav = (Button) findViewById(R.id.bfav); Typeface font1 = Typeface.createFromAsset(getAssets(), "Sanvito.ttf"); gofav.setTypeface(font1); Button goindex = (Button) findViewById(R.id.bindex); Typeface font2 = Typeface.createFromAsset(getAssets(), "Sanvito.ttf"); goindex.setTypeface(font2); Button extras = (Button) findViewById(R.id.bextra1); Typeface font3 = Typeface.createFromAsset(getAssets(), "Sanvito.ttf"); **extras.setTypeface(font3);** //Line 29 TextView minit = (TextView) findViewById(R.id.minititle); Typeface font4 = Typeface.createFromAsset(getAssets(), "Alba.TTF"); minit.setTypeface(font4); gogym.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Intent gogymint = new Intent("com.irespekt.gymbook.GOTOgym"); startActivity(gogymint); } }); gofav.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Intent gofavint = new Intent("com.irespekt.gymbook.GOTOFAV"); startActivity(gofavint); } }); goindex.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Intent goindexint = new Intent( "com.irespekt.gymbook.INDEXPAGEACTIVITY"); startActivity(goindexint); } }); extras.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Intent extrasint = new Intent( "com.irespekt.gymbook.PICTUREVIEWFLIP"); startActivity(extrasint); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.the_beginning, menu); return true; } } </code></pre> <p>EDIT</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.com.irespekt.gymbook" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;activity android:name="com.irespekt.gymbook.TheBeginning" 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.irespekt.gymbook.GoToGym" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="com.irespekt.gymbook.GOTOGYM" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="com.irespekt.gymbook.GoToFav" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="com.irespekt.gymbook.GOTOFAV" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="com.irespekt.gymbook.IndexPageActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="com.irespekt.gymbook.INDEXPAGEACTIVITY" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="com.irespekt.gymbook.WebViewActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="com.irespekt.gymbook.WEBVIEWACTIVITY" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="com.irespekt.gymbook.PictureViewFlip" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="com.irespekt.gymbook.PICTUREVIEWFLIP" /&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>LAYOUT XML</p> <pre><code>&lt;LinearLayout android:id="@+id/LinearLayout04" android:layout_width="fill_parent" android:layout_height="186dp" android:layout_weight="16.78" android:orientation="vertical" &gt; &lt;Button android:id="@+id/bgym" style="@style/btnStylePaprika" android:layout_width="150dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="15.0dip" android:text="Go To Gym" android:textSize="20.0sp" /&gt; &lt;Button android:id="@+id/bfav" style="@style/btnStylePaprika" android:layout_width="150dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="5.0dip" android:text="Favorites" android:textSize="20.0sp" /&gt; &lt;Button android:id="@+id/bindex" style="@style/btnStylePaprika" android:layout_width="150dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="5.0dip" android:text="Index" android:textSize="20.0sp" /&gt; &lt;Button android:id="@+id/bextra1" style="@style/btnStylePaprika" android:layout_width="150dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="5.0dip" android:text="Extras" android:textSize="20.0sp" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>LOGCAT</p> <pre><code>11-28 12:35:42.598: D/dalvikvm(875): GC_FOR_ALLOC freed 69K, 6% free 2589K/2732K, paused 243ms, total 257ms 11-28 12:35:42.658: I/dalvikvm-heap(875): Grow heap (frag case) to 4.638MB for 2139636-byte allocation 11-28 12:35:42.761: D/dalvikvm(875): GC_FOR_ALLOC freed 2K, 4% free 4676K/4824K, paused 106ms, total 106ms 11-28 12:35:44.048: D/AndroidRuntime(875): Shutting down VM 11-28 12:35:44.048: W/dalvikvm(875): threadid=1: thread exiting with uncaught exception (group=0x414c4700) 11-28 12:35:44.148: E/AndroidRuntime(875): FATAL EXCEPTION: main 11-28 12:35:44.148: E/AndroidRuntime(875): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.irespekt.gymbook/com.irespekt.gymbook.TheBeginning}: java.lang.NullPointerException 11-28 12:35:44.148: E/AndroidRuntime(875): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211) 11-28 12:35:44.148: E/AndroidRuntime(875): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) 11-28 12:35:44.148: E/AndroidRuntime(875): at android.app.ActivityThread.access$600(ActivityThread.java:141) 11-28 12:35:44.148: E/AndroidRuntime(875): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) 11-28 12:35:44.148: E/AndroidRuntime(875): at android.os.Handler.dispatchMessage(Handler.java:99) 11-28 12:35:44.148: E/AndroidRuntime(875): at android.os.Looper.loop(Looper.java:137) 11-28 12:35:44.148: E/AndroidRuntime(875): at android.app.ActivityThread.main(ActivityThread.java:5103) 11-28 12:35:44.148: E/AndroidRuntime(875): at java.lang.reflect.Method.invokeNative(Native Method) 11-28 12:35:44.148: E/AndroidRuntime(875): at java.lang.reflect.Method.invoke(Method.java:525) 11-28 12:35:44.148: E/AndroidRuntime(875): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 11-28 12:35:44.148: E/AndroidRuntime(875): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 11-28 12:35:44.148: E/AndroidRuntime(875): at dalvik.system.NativeStart.main(Native Method) 11-28 12:35:44.148: E/AndroidRuntime(875): Caused by: java.lang.NullPointerException 11-28 12:35:44.148: E/AndroidRuntime(875): at com.irespekt.gymbook.TheBeginning.onCreate(TheBeginning.java:29) 11-28 12:35:44.148: E/AndroidRuntime(875): at android.app.Activity.performCreate(Activity.java:5133) 11-28 12:35:44.148: E/AndroidRuntime(875): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 11-28 12:35:44.148: E/AndroidRuntime(875): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175) 11-28 12:35:44.148: E/AndroidRuntime(875): ... 11 more 11-28 12:36:09.321: I/Process(875): Sending signal. PID: 875 SIG: 9 </code></pre>
 

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