android - Why can't we just call new Activity() -


so, kind of noob situation, today, out of curiosity, tried like:

new activity().runonuithread( new runnable{...})

mostly because don't have access activities (working on 3rd party library). have applicationcontext, don't think allows me make runonuithread call.

so guess i'm kind of wondering if there way somehow fake out minimally-invasive activity can run on ui thread (or other things, pop dialog...etc.) ??

if not, know what's wrong making new activity() ? ( mean, aside fact that, yes, null pointer because haven't set base context since oncreate activity never got called ). if possible, accept answer can provide little more detail , more "context" (no pun intended)

new handler(context.getmainlooper()).post(new runnable() {     @override     public void run()     {     } }); 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -