一个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) 关于Activity中应用showDialog等方法 android 授权管理的问题,高手请进 大侠们请进,关于ListView中RadioButton单选问题。 毕设做一个安卓下的浏览器 各位谁知道遍历一次数据库即可将联系人姓名跟号码一起查询出来 如何用code模拟对power key 或 camera key的press? 急!!!!SAX或者PULL解析.xml文件的问题 android绘图 Android访问https不成功 Android Studio 跪求!!安卓如何自定义键盘?? 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)