I m trying to call an object constructor into a runnable but Eclipse return error.
The
simpleAdapter = new SimpleStandardAdapter(this, manager, LEVEL_NUMBER, this, headendDataLookup, findViewById(R.id.moduleDetailView));
is not accepted into the runnable. the problem are related to this variables. the eclipse suggest theses variable with Runnable
public void updateTreeView()
{
this.runOnUiThread(new Runnable() {
@Override
public void run() {
if (treeView == null)
return;
updateTreeContent();
simpleAdapter = new SimpleStandardAdapter(this, manager, LEVEL_NUMBER, this, headendDataLookup, findViewById(R.id.moduleDetailView));
setTreeAdapter(TreeType.SIMPLE);
setCollapsible(true);
registerForContextMenu(treeView);
manager.collapseChildren(null);
}
});
}
You will need a context object. So use
instead of
this.In your case
thispoints torunnable