(我有類MainActivity(擴展活動),在那裏我有方法setContentView(GameView); GameView是一個類擴展視圖和在這個類(GameView)我有方法:ANDROID從視圖移動到另一個活動
boolean inTouchEvent(MotionEvent event){
switch(event.getAction()){
case MotionEvent.ACTION_DOWN:
//here I would like to go to another activity to class MainMenuActivity()
}
}
在此先感謝
好它的工作:
public boolean onTouchEvent(MotionEvent event){
switch(event.getAction()){
case MotionEvent.ACTION_DOWN:
Intent intent = new Intent (contexTmp, MainActivity.class);
contexTmp.startActivity(intent);
((Activity)getContext()).finish();
}
}
什麼是問題? – jeet 2012-07-26 12:43:41
嚴重嗎?你甚至知道文檔存在嗎?爲什麼堵塞這個問題...一個谷歌搜索可以告訴你這100倍。請訪問這裏的文檔:http://developer.android.com/develop/index.html – trgraglia 2012-07-26 12:48:56