Friends, I am really struck up in a really really weird problem.
My logcat shows the activity is launched but the emulator simply shows a blank white page instead of the desired activity(In logcat, Clfbpg
is the java file which wont load).
Here is the logcat.
02-23 16:00:43.237: I/ActivityManager(65): Displayed activity com.tmrepo/.Client: 4387 ms (total 4387 ms)
02-23 16:00:45.287: D/dalvikvm(293): GC_EXPLICIT freed 46 objects / 2168 bytes in 9619ms
02-23 16:00:55.946: D/dalvikvm(263): GC_EXTERNAL_ALLOC freed 2219 objects / 86480 bytes in 320ms
02-23 16:00:56.236: W/KeyCharacterMap(263): No keyboard for id 0
02-23 16:00:56.236: W/KeyCharacterMap(263): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
02-23 16:00:58.656: D/dalvikvm(129): GC_EXPLICIT freed 766 objects / 42248 bytes in 7048ms
02-23 16:01:04.418: I/ActivityManager(65): Starting activity: Intent { cmp=com.tmrepo/.Clwelcome2 }
02-23 16:01:06.887: I/ActivityManager(65): Displayed activity com.tmrepo/.Clwelcome2: 2112 ms (total 2112 ms)
02-23 16:01:10.520: D/dalvikvm(702): GC_FOR_MALLOC freed 6993 objects / 306016 bytes in 236ms
02-23 16:01:15.327: I/ActivityManager(65): Starting activity: Intent { cmp=com.tmrepo/.Clfbpg }
02-23 16:01:17.237: I/ActivityManager(65): Displayed activity com.tmrepo/.Clfbpg: 1777 ms (total 1777 ms)`
My app has many pages where just one particular page is not loading. other pages work fine. I did every possible thing to get that page running but just cant get the error.
I tried connecting another layout to the java file instead of the layout I wanted. But all is same.
My XML Code is `
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="18dp"
android:text="@string/feedback"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/texthome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="28dp"
android:layout_marginLeft="18dp"
android:text="@string/home"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#ff0057" />
<EditText
android:id="@+id/tbproname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_centerHorizontal="true"
android:layout_marginTop="32dp"
android:ems="10"
android:hint="@string/proname"
android:textColor="#ffffff" />
<Button
android:id="@+id/submit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tbproname"
android:layout_centerHorizontal="true"
android:layout_marginTop="24dp"
android:text="@string/feedback" />
`
I think the problem is with java file.
And my java file is ` package com.tmrepo;
import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; //import android.widget.ScrollView; import android.widget.TextView;
public class Clfbpg extends Activity {
EditText tbproname;
TextView texthome;
Button submit;
public void OnCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.feedform);
tbproname = (EditText)findViewById(R.id.tbproname);
texthome = (TextView)findViewById(R.id.texthome);
submit = (Button)findViewById(R.id.submit);
//scroll = (ScrollView)findViewById(R.id.scroll);
texthome.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent1();
finish();
}
public void Intent1() {
// TODO Auto-generated method stub
Intent i1 = new Intent();
i1.setClass(Clfbpg.this,Clwelcome2.class);
startActivity(i1); }
});
submit.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent2();
finish();
}
public void Intent2() {
// TODO Auto-generated method stub
Intent i2 = new Intent();
i2.setClass(Clfbpg.this,Clwelcome2.class);
startActivity(i2);
}
});
}}
Can anyone here has any idea about this irritating problem? Many Thanks. I have been trying to solve it since 2 days.
See Question&Answers more detail:os