Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi guys
im using AsyncTask class in my android project .
can i create a new button in onProgressUpdate() method ?!
i can find elements inside of this method but it seems i cant create a new one !
when i want to create a new one it says :
the constructor Button (MMainActivity.RetriveFeedTask) is undefined !

do you have any suggestion ?!
Posted
Updated 15-Dec-14 2:34am
v2

1 solution

Button takes a Context as it's constructor parameter (and possibly an AttributeSet and an int, but that's not important here), but you're passing something MMainActivityRetrieveFeedTask which I am guessing is not a Context.

Try creating the button by passing in just your MMainActivity;
Java
Button b = new Button(MMainActivity);

Hope this helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900