我刚刚开始发展,因此,请与我一道。
我的问题是,在我进行猛烈的屏幕后,当我掌握在主人身上时,登上下台的屏幕与我在座的完全不同。 两种相互冲突的屏幕名称相同(主角xml),因此它们可能与它有某种关系,但它们具有完全不同的组合和工作空间。 我一直在尝试用我的守则,在我猛烈的屏幕后,停止屏幕,彻底显示,因此,我可以更好地了解问题在何地发生,但却没有成功。
是否有任何想法可能错了,或至少应该开始寻求解决这一问题?
<>strong>files in eclipse:https://i.stack.imgur.com/wAKG1.jpg
package com.mwmnj.criticmatch;
import android.app.Activity;
import android.os.Bundle;
public class CriticMatchActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
main.xml:
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:padding="20dp"
android:weightSum="1">
<TextView android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@+id/textView1" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Hello!"
android:layout_gravity="center" />
<TextView android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/textView2" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="criticmatch">android:layout_gravity="center"></TextView>
<Button android:text="Proceed" android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/button1"
android:layout_marginTop="50dp" />
</LinearLayout>
Splash class:
package com.mwmnj.criticmatch;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
public class Splash extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Thread timer = new Thread(){
public void run(){
try{
sleep(5000);
} catch (InterruptedException e){
e.printStackTrace();
}finally{
Intent openStartingPoint = new Intent("matt.meyer.criticmatch.MENU");
startActivity(openStartingPoint);
}
}
};
timer.start();
}
}
<>strong>splash.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/crbackground"
>
</LinearLayout>
<>strong>androidmani.4/1999/.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mwmnj.criticmatch"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Splash"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".CriticMatchActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="com.mwmnj.criticmatch.CRITICMATCHACTIVITY"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>