【发布时间】:2014-07-04 00:42:39
【问题描述】:
我在使用 Theme.Dialog 完成 Activity 时遇到问题 .. 在返回上一个 Activity 之前,需要双击返回按钮来完成 Activity。一按返回按钮 = 隐藏活动(Theme.Dialog),二按返回上一个活动。
还有这段代码 Acitivity (Theme.Dialog )
package com.tracking.bus.track;
import com.tracking.bus.R;
import org.holoeverywhere.app.Activity;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
import android.content.Intent;
import org.holoeverywhere.app.Dialog;
public class language extends Activity {
private Ringtone r;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.main);
Uri alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);
if(alert == null){
// alert is null, using backup
alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
// I can't see this ever being null (as always have a default notification)
// but just incase
if(alert == null) {
// alert backup is null, using 2nd backup
alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
}
}
Dialog dialog = new Dialog(language.this);
dialog.setContentView(R.layout.dialog_notifikasi);
dialog.setTitle("Raygional");
dialog.show();
r = RingtoneManager.getRingtone(language.this, alert);
r.play();
}
@Override
public void onStop() {
super.onStop();
if(r.isPlaying())
{
r.stop();
}
finish();
}
}
那么,隐藏/关闭活动时如何使用 Theme.Dialog 完成活动?对不起我的英语
【问题讨论】:
-
Hablas español 还是英语?