gpt4 book ai didi

java - 为什么这个 Activity 没有开始?

转载 作者:行者123 更新时间:2023-12-01 17:24:28 24 4
gpt4 key购买 nike

我是 Android 开发新手。我有一项 Activity 甚至没有达到其 onCreate()功能。我正在使用一些“Log.d”来检查控制流,并且 onCreate 内没有 Log.d在运行时执行。我究竟做错了什么?类(class)的开始部分如下:

 public class MainActivityap extends Activity
implements IMediaPlayerServiceClient {
private StatefulMediaPlayer mMediaPlayer;

private StreamStation mSelectedStream = new StreamStation("","http://nbc.com/154.mp3");
private MediaPlayerService mService;
private boolean mBound;

private ProgressDialog mProgressDialog;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
Log.d("msg", "msg0");
super.onCreate(savedInstanceState);
Log.d("msg", "msg1");
setContentView(R.layout.main);
Log.d("msg", "msg2");
bindToService();
Log.d("msg", "msg3");
mProgressDialog = new ProgressDialog(this);
Log.d("msg", "msg4");
initializeButtons();
setupStationPicker();
}.....

最佳答案

将评论转换为答案。

AndroidManifest.xml 中注册您的 Activity 。

<activity
android:name="MainActivityap"
/>

关于java - 为什么这个 Activity 没有开始?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16132601/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com