android.app.Application cannot be cast to android.app.Activity

If you using Context as parameter of function try this solution:

public class MyActivity extends Activity {
// bla bla bla .......
//error 
myFc( getapplicationcontext());
// OK
myFc(MyActivity.this);
This entry was posted in Android Examples Code, Bugs, warnings, errors and tagged . Bookmark the permalink.


Comments are closed.



7,354 views