MostVisitedActivitypublic class MostVisitedActivity extends android.app.ListActivity
Fields Summary |
---|
private MyAdapter | mAdapter |
Methods Summary |
---|
private void | loadUrl(java.lang.String url, boolean newWindow)
Intent intent = new Intent().setAction(url);
if (newWindow) {
Bundle b = new Bundle();
b.putBoolean("new_window", true);
intent.putExtras(b);
}
setResultToParent(RESULT_OK, intent);
finish();
| public void | onCreate(android.os.Bundle savedInstanceState)
super.onCreate(savedInstanceState);
mAdapter = new MyAdapter();
CombinedBookmarkHistoryActivity.getIconListenerSet(getContentResolver())
.addListener(new IconReceiver());
setListAdapter(mAdapter);
ListView list = getListView();
LayoutInflater factory = LayoutInflater.from(this);
View v = factory.inflate(R.layout.empty_history, null);
addContentView(v, new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT));
list.setEmptyView(v);
| protected void | onListItemClick(android.widget.ListView l, android.view.View v, int position, long id)
TextView tv = (TextView) v.findViewById(R.id.url);
String url = tv.getText().toString();
loadUrl(url, false);
| private void | setResultToParent(int resultCode, android.content.Intent data)
Activity a = getParent() == null ? this : getParent();
a.setResult(resultCode, data);
|
|