一个activity(1)调用另外一个activity(2),2上面的控件没有显示?? 一个activity(1)调用另外一个activity(2),2上面的控件没有显示??我在1上面做了个按钮,调出2,2上面也有按钮等,2显示后,没有控件显示出来,请教各位是什么原因?本人刚开始学习,莫笑啊,呵呵 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 把2的xml和activity代码贴下。。 package com.example.test2;import android.app.Activity;import android.os.Bundle;public class NewActivity extends Activity { protected void OnCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.new_activity); Bundle bundle = this.getIntent().getExtras(); String name = bundle.getString("name"); int age = bundle.getInt("age"); }} <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#000000" android:text="@string/hello_world" tools:context=".NewActivity" /> </AbsoluteLayout> AbsoluteLayout 时绝对布局,系统没提示你,你需要给控件设置layout_x,和layout_y吗? 搞定了,在java代码里面加入 @override,把OnCreate改成onCreate即可,大写变小写,坑爹的java,呵呵。public class NewActivity extends Activity { @override protected void onCreate(Bundle savedInstanceState) 网易客户端消息推送 android 登陆界面有2个edittext点击edittext弹出软键盘但是界面无法滑动 android源码下使用webrtc库的问题 在android下编译.C程序出错 关于Activity的疑惑 关于开机启动的一个难题,等待高手 Android 在一个Dialog里面,如何FindViewById找到自定义的CheckBox 谁有图片查看器的代码? HTC Hero 使用的是什么版本的Android系统? android studio的jni调试是怎么使用LLDB调试的 跪求!!安卓如何自定义键盘?? untracked pid xxx exited
package com.example.test2;import android.app.Activity;
import android.os.Bundle;public class NewActivity extends Activity {
protected void OnCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.new_activity);
Bundle bundle = this.getIntent().getExtras();
String name = bundle.getString("name");
int age = bundle.getInt("age");
}
}
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" > <TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#000000"
android:text="@string/hello_world"
tools:context=".NewActivity" /> </AbsoluteLayout>
public class NewActivity extends Activity {
@override
protected void onCreate(Bundle savedInstanceState)