java - Event listener on view in tabs when not extending TabActivity -


i have android app extends mapactivity, can't extend tabactivity. inflating content of tabs dynamically, , looks good.

the problem i'm running in nullpointerexception when trying bind event listeners views inflated tab past first tab.

example:

mybuttonintab2 = (button)this.findviewbyid(r.id.mybuttonintab2); mybuttonintab2.setonclicklistener(new onclicklistener(){     public void(view v){         ///blah blah blah     } }); 

if "inflating content of tabs dynamically", should calling findviewbyid() on result of inflate() call, widgets in tab.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -