|
|
|
Android สอบถามเรื่องคำสั่งเปลี่ยนหน้าโดยไม่ต้องกดปุ่ม ใครรู้รบกวนตอบทีครับผม |
|
|
|
|
|
|
|
ผมเคยเขียนไว้แบบนี้ครับ
Code (Android-Java)
package com.example.asian;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.Window;
import android.view.WindowManager;
public class MainActivity extends Activity {
private static final int REFRESH_SCREEN = 1;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_main);
startScan();
}
public void startScan() {
new Thread() {
public void run() {
try{
Thread.sleep(3000);
hRefresh.sendEmptyMessage(REFRESH_SCREEN);
}catch(Exception e){
}
}
}.start();
}
Handler hRefresh = new Handler(){
public void handleMessage(Message msg) {
switch(msg.what){
case REFRESH_SCREEN:
Intent newActivity = new Intent(MainActivity.this,HomeActivity.class);
startActivity(newActivity);
break;
default:
break;
}
}
};
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
|
|
|
|
|
Date :
2013-02-25 19:46:03 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณมากนะครับพี่วิน
|
|
|
|
|
Date :
2013-02-26 08:21:40 |
By :
DragonZKiLL |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
จัดไป
|
|
|
|
|
Date :
2013-02-26 08:47:30 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|