开发者

How to pass a value from a main activity to a sub activity using intent?

开发者 https://www.devze.com 2023-02-06 21:27 出处:网络
I used a listview clist and usedclist.setOnItemClickListener(new AdapterView.OnItemClickListener() { Now i want to get the item which i clickedon a su开发者_JAVA技巧b activity which i called using an

I used a listview clist and used clist.setOnItemClickListener(new AdapterView.OnItemClickListener() { Now i want to get the item which i clicked on a su开发者_JAVA技巧b activity which i called using an intent. How can i do this???? Thanks in advance for those help me....


clist.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int position,
                long arg3)
        {
            String xy=clist.getItemAtPosition(position).toString();
            temp=xy.split("-");
                            String xz=temp[0]; 
                Intent intente=new Intent(Cardetails.this,EditPage.class);
                intente.putExtra("key",xz);
            startActivityForResult(intente, var2);  

        }

    });

var2 is the request code.

0

精彩评论

暂无评论...
验证码 换一张
取 消