At the start, create intance variable before onCreate() method like public static InstanceTest instance; public void onCreate(Bundle savedInstanceState) { super. OnCreate(savedInstanceState); instance=this; } And called that variable in your child on click event public void onClick(View arg0) { Intent i=new Intent(instance,FindFilesByType. Class);//This time it will be allowed } Hope this can help.
The this object in your Intent constructor is the anonymous OnClickListener class instance, as opposed to your current context. What you need to do is to use the current context in that constructor like: Intent I = new Itent(getContext(), FindFilesByType. Class).
No this is not working for me thanks :) – Pragna Jun 3 at 4:36 finally I got the solution I used btnPlay. SetOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { Log. I("TEST ", "play btn cliked"); Intent i=new Intent(context,PlayingActivity.
Class); context. StartActivity(i); } }); and this is working – Pragna Jun 3 at 4:36.
Public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { View v = null; if (convertView! = null) v = convertView; else v = inflater. Inflate(R.layout.
Child_row, parent, false); Rington c = (Rington) getChild(groupPosition, childPosition); TextView color = (TextView) v. FindViewById(R.id. Childname); if (color!
= null) color. SetText(c.getColor()); TextView rgb = (TextView) v. FindViewById(R.id.
Rgb); if (rgb! = null) rgb. SetText(c.getRgb()); Button btnPlay = (Button) v.
FindViewById(R.id. Play); Button btnDelete = (Button) v. FindViewById(R.id.
Delete); Button btnEmail = (Button) v. FindViewById(R.id. Email); btnPlay.
SetOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { //code } }); btnDelete. SetOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { //code } }); btnEmail. SetOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { //code } }); return v; } this above methos into the adapter class this is fully working code for me :).
Hello I have succeeded to make an expandable list view in my app from an example and much struggle, but I don't really understand how I succeeded to get the right index the user clicked, I mean, I don't really know what's in childData and how groupData and childData are related to each other. I need some help understanding this guys, I had never seen generics in this way. 1- How childData and groupData are related to each other, is groupData into childData Map?
2- How can String selectedWord = childData. Get the right word and header(or group) in the listView? Thanks for your time.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.