logcat的显示器推出,但活动犯规推出模拟器模拟器、显示器、logcat

2023-09-12 05:42:14 作者:如何能对得起你

朋友们,我真的打起来了真的很奇怪的问题。

Friends, I am really struck up in a really really weird problem.

我的logcat显示该活动推出,但仿真器只显示一个空白页,而不是所需要的活动(在logcat中, Clfbpg 是不会加载java文件)

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).

下面是logcat的。

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.

我试图连接另一个布局到java文件,而不是我想要的布局。但是,都是一样。

I tried connecting another layout to the java file instead of the layout I wanted. But all is same.

我的XML code是 `

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

`

我认为这个问题是用java文件。

I think the problem is with java file.

和我的Java文件 `包com.tmrepo;

And my java file is ` package com.tmrepo;

进口android.app.Activity; 进口android.content.Intent; 进口android.os.Bundle; 进口android.view.View; 进口android.view.View.OnClickListener; 进口android.widget.Button; 进口android.widget.EditText; //进口android.widget.ScrollView; 进口android.widget.TextView;

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;

公共类Clfbpg延伸活动{

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);
        }
    }); 
}}

这里

任何人都可以有这个恼人的问题任何想法? 非常感谢。我一直在试图解决它,因为2天。

Can anyone here has any idea about this irritating problem? Many Thanks. I have been trying to solve it since 2 days.

推荐答案

永远记得androidmainfest.xml只是觉得。确保哟首先增加Clfbpg班级活动第一。为您在AndroidManifest.xml文件。

Always remember about androidmainfest.xml and just think . Make sure that yo are first adding to Clfbpg class activity first. check in AndroidManifest.xml file.

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

这应该是第一个电话。告诉我吧。

this should be call first . tell me about it.