80,360
社区成员
发帖
与我相关
我的任务
分享
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Button
android:id="@+id/start_normal_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Start NormalActivity" />
<Button
android:id="@+id/start_dialog_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Start DialogActivity" />
</LinearLayout>
public class MainActivity extends Activity {
public static final String TAG="MainActivity";
@Override
protected void onCreate(Bundle saveInstanceState){
super.onCreate(saveInstanceState);
Log.d(TAG,"onCreate");
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
Button startNormalActivity=(Button) findViewById(R.id.start_normal_activity);
}
亲,你怎么知道没找到对应的id呢?你调用了吗?你的错误log呢?
[quote=引用 2 楼 u012870504 的回复:] [quote=引用 1 楼 u013377714 的回复:] 亲,你怎么知道没找到对应的id呢?你调用了吗?你的错误log呢?
[quote=引用 2 楼 u012870504 的回复:] [quote=引用 1 楼 u013377714 的回复:] 亲,你怎么知道没找到对应的id呢?你调用了吗?你的错误log呢?
[quote=引用 1 楼 u013377714 的回复:] 亲,你怎么知道没找到对应的id呢?你调用了吗?你的错误log呢?
亲,你怎么知道没找到对应的id呢?你调用了吗?你的错误log呢?