2 qq 32565575 qq_32565575 于 2016.02.29 19:59 提问

这是什么类型错误?看了蛮久

对着视频中写了一个expandablelist,到错了求教图片

 一个小部分:跳转页面
if(msg.arg1==100){
                String facterstr = text_02.getText().toString();
            Intent intent = new Intent();
            intent.putExtra("name",facterstr);
            intent.setClass(denglu.this,main.class);
            denglu.this.startActivity(intent);
            }
Main的代码:
public class main extends ExpandableListActivity{
    TextView text_01;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
       text_01 = (TextView)findViewById(R.id.text);
         Intent intent = getIntent();
         String fcterone = intent.getStringExtra("name");
        text_01.setText(fcterone);


        List<Map<String,String>> groups = new ArrayList<Map<String,String>>();
        Map<String,String> group1= new HashMap<String,String>();
        group1.put("group","我的家人" );
        Map<String,String> group2= new HashMap<String,String>();
        group2.put("group","朋友" );
        groups.add(group1);
        groups.add(group2);

        List<Map<String,String>> child1 = new ArrayList<Map<String,String>>();
        Map<String,String> child1Data1 = new HashMap<String,String>();
        child1Data1.put("child","张珊");
        child1.add(child1Data1);
        Map<String,String> child1Data2 = new HashMap<String,String>();
        child1Data2.put("child","李斯");
        child1.add(child1Data2);
        List<Map<String,String>> child2 = new ArrayList<Map<String,String>>();
        Map<String,String> child2Data1 = new HashMap<String,String>();
        child2Data1.put("child","张珊");
        child2.add(child2Data1);
        Map<String,String> child2Data2 = new HashMap<String,String>();
        child2Data2.put("child","李斯");
        List<List<Map<String,String>>> childs = new ArrayList<List<Map<String,String>>>();
        child2.add(child2Data2);
        childs.add(child1);
        childs.add(child2);


        SimpleExpandableListAdapter sela = new SimpleExpandableListAdapter(this, groups,R.layout.group, new String[]{"group"},new int[]{R.id.groupTo}, childs, R.layout.child, new String[]{"child"},new int[]{R.id.childTo});
        setListAdapter(sela);
    }
}
Main的xml文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    tools:context="com.example.helper.main"
    tools:ignore="MergeRootFrame" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="81dp"
            android:orientation="horizontal" >

            <ImageView
                android:layout_width="104dp"
                android:paddingTop="0dp"
                android:layout_height="78dp"
                android:src="@drawable/touxiang" />

            <TextView 
                android:textSize="10pt"            
                android:layout_width="wrap_content"
                android:paddingTop="15dp"
                android:paddingLeft="15dp"
                android:layout_height="wrap_content"
                android:id="@+id/text"
                android:text="@string/boy"/>
            </LinearLayout>

            <LinearLayout 
             android:layout_width="fill_parent"
             android:layout_height="0dip"
             android:orientation="vertical"
             android:layout_weight="6">
             <ExpandableListView
                 android:id="@id/android:list"
                 android:layout_width="fill_parent"
                 android:layout_height="fill_parent"
                 android:drawSelectorOnTop="false"/>
             <TextView 
                 android:id="@+id/text_003"
                 android:layout_width="fill_parent"
                 android:layout_height="fill_parent"
                 android:text="No data"/>
         </LinearLayout>
</LinearLayout>
我一共写了三个activity,可以编译成功但是当点击按钮跳转到第三个activity的时候程序蹦了。


2个回答

devmiao
devmiao   Ds   Rxr 2016.02.29 22:03
qq_32565575
qq_32565575 检查了一下,不是这方面的错。请问还有什么可能?
接近 2 年之前 回复
ji1ruan
ji1ruan   2016.03.02 09:59

清单文件没有注册。最好贴代码

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!