-1

友達、私は本当に本当に奇妙な問題に本当に悩まされています。

私のlogcatはアクティビティが起動されたことを示していますが、エミュレータは目的のアクティビティの代わりに空白の白いページを表示します(logcatでは、ClfbpgロードされないJavaファイルです)。

これが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)`

私のアプリには多くのページがあり、特定の1ページだけが読み込まれていません。他のページは正常に動作します。私はそのページを実行するために可能な限りのことをしましたが、エラーを取得できませんでした。

必要なレイアウトではなく、別のレイアウトをJavaファイルに接続してみました。しかし、すべて同じです。

私のXMLコードは`です

<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" />

`

問題はJavaファイルにあると思います。

そして私のJavaファイルは`packagecom.tmrepo;です。

import android.app.Activity; import android.content.Intent; android.os.Bundleをインポートします。android.view.Viewをインポートします; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; //android.widget.ScrollViewをインポートします; android.widget.TextViewをインポートします;

パブリッククラスClfbpgは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);
        }
    }); 
}}

ここの誰かがこの苛立たしい問題について何か考えを持っていますか?どうもありがとう。私は2日からそれを解決しようとしています。

4

2 に答える 2

1

常にandroidmainfest.xmlについて覚えて、考えてみてください。yoが最初にClfbpgクラスのアクティビティに最初に追加していることを確認してください。AndroidManifest.xmlファイルをチェックインします。

<activity android:name="Clfbpg"> 
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</activity>

これを最初に呼び出す必要があります。それについて教えて。

于 2013-02-23T11:02:49.830 に答える
0

これらの2行をに追加する必要がある場合がありますAndroidManifest.xml

<activity android:name="Clfbpg">
    <action android:name="android.intent.action.MAIN" />          <-----
    <category android:name="android.intent.category.LAUNCHER" />  <----
...
</activity>

そのため、モバイル画面にアイコンが作成され、アプリを起動できるようになります。

于 2013-02-23T11:02:25.143 に答える