New activity /xml file doesn't display anything

ckmarkhsu

New Member
I have created a new activity call about.java that suppose to display some content using a new xml file. It doesn't display anything, doesn't crash and the log cat doesn't throw any error.Here is my code calling the new activity\[code\]public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case 1: Log.d("**MYLOG**", "Refresh clicked .. "); Intent intent = new Intent(this, MainActivity.class); this.startActivity(intent); return true; case 2: //setContentView(R.layout.about); Log.d("**MYLOG**", "About clicked .. "); Intent intent2 = new Intent(this, About.class); this.startActivity(intent2); return true;\[/code\]Here is my about.classpublic class About extends Activity {\[code\]public void About(Bundle about) { Log.d("**MYLOG**", "Inside About.java .."); super.onCreate(about); setContentView(R.layout.about);}\[/code\]and my about.xml\[code\]<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="horizontal"> <TextView android:id="@+id/textView1" android:layout_width="match_parent" android:layout_height="wrap_content" android:textStyle="bold" android:typeface="sans" android:textSize="18dp" android:text="About page" android:gravity="center"></TextView>\[/code\]The last thing i see in the log cat is "About clicked .." which i got it in my main classI don see the "Inside About.java" entry in logcat either
 
Back
Top