一个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 activity切换的动画效果问题 问一个有关ContentProvider的问题,有关自定义Cursor。PS:100%结贴,期待各位达人指点 填充一个android2.2版本的平面要多大的像素? eclipse 项目 移植 UBOOT LINUX 系统解压完后就不动了 android数据库操作 一个安卓虚拟机的问题 android 字符串字节转换 Http 请求返回值不一样怎么办? [福音][散发]从github下载Android最新源码 跪求!!安卓如何自定义键盘?? 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)