這裏是我的應用程序應該如何工作http://postimg.org/image/57byitwpz/ 這裏是錯誤的即時得到http://postimg.org/image/ynyqerln9/ 請DONOT給任何東西在我的代碼,而不是添加糾正我的代碼。 香港專業教育學院誤寫的.xml代替的.class在第一幅圖像,請忽略如何檢測網絡,並打開無線設置
here is my code
**SplashScreen.java**
public class SplashScreen extends Activity {
if (!NetworkCheckClass.haveNetworkConnection(SplashActivity.this)) {
Toast.makeText(SplashScreen.this, "No internet connection!",Toast.LENGTH_LONG).show();
Intent intent=new Intent(Settings.ACTION_WIRELESS_SETTINGS);
startActivity(intent);
}
else {
// your code if connection is available
// this is my code of splash screen
private static int SPLASH_TIME_OUT = 3000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
new Handler().postDelayed(new Runnable() {
/*
* Showing splash screen with a timer. This will be useful when you
* want to show case your app logo/company
*/
@Override
public void run() {
// This method will be executed once the timer is over
// Start your app main activity
Intent i = new Intent(SplashScreen.this, MainActivity.class);
startActivity(i);
// close this activity
finish();
}
}, SPLASH_TIME_OUT);
}
}
NIKHIL youractivity konsi活動hogi? – 01wifi01
我不想要額外的對話,可以修復我的代碼嗎? – 01wifi01
確定沒有錯誤終於 – 01wifi01