嗨
我寫了一個小程序,將打開默認瀏覽器並直接導入到URL。我的問題是,當我點擊Android的後退按鈕,它會返回一個空白頁,我能怎樣改變退出程序,而不是迴歸到一個空白頁Android - Android的後退按鈕問題
的代碼以供參考:
package com.example.helloandroid;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.TextView;
public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent httpIntent = new Intent(Intent.ACTION_VIEW);
httpIntent.setData(Uri.parse("http://www.bbc.co.uk/"));
startActivity(httpIntent);
}
}