本文整理汇总了Java中org.zirco.utils.ApplicationUtils.sharePage方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationUtils.sharePage方法的具体用法?Java ApplicationUtils.sharePage怎么用?Java ApplicationUtils.sharePage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.zirco.utils.ApplicationUtils
的用法示例。
在下文中一共展示了ApplicationUtils.sharePage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onContextItemSelected
import org.zirco.utils.ApplicationUtils; //导入方法依赖的package包/类
@Override
public boolean onContextItemSelected(MenuItem item) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
WeaveBookmarkItem bookmarkItem = BookmarksProviderWrapper.getWeaveBookmarkById(getContentResolver(), info.id);
switch (item.getItemId()) {
case MENU_OPEN_IN_TAB:
Intent i = new Intent();
i.putExtra(Constants.EXTRA_ID_NEW_TAB, true);
i.putExtra(Constants.EXTRA_ID_URL, bookmarkItem.getUrl());
if (getParent() != null) {
getParent().setResult(RESULT_OK, i);
} else {
setResult(RESULT_OK, i);
}
finish();
return true;
case MENU_COPY_URL:
ApplicationUtils.copyTextToClipboard(this, bookmarkItem.getUrl(), getString(R.string.Commons_UrlCopyToastMessage));
return true;
case MENU_SHARE:
ApplicationUtils.sharePage(this, bookmarkItem.getTitle(), bookmarkItem.getUrl());
return true;
default: return super.onContextItemSelected(item);
}
}
示例2: onContextItemSelected
import org.zirco.utils.ApplicationUtils; //导入方法依赖的package包/类
@Override
public boolean onContextItemSelected(MenuItem menuItem) {
ExpandableListContextMenuInfo info = (ExpandableListContextMenuInfo) menuItem.getMenuInfo();
int type = ExpandableListView.getPackedPositionType(info.packedPosition);
if (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
int group = ExpandableListView.getPackedPositionGroup(info.packedPosition);
int child = ExpandableListView.getPackedPositionChild(info.packedPosition);
HistoryItem item = (HistoryItem) getExpandableListAdapter().getChild(group, child);
switch (menuItem.getItemId()) {
case MENU_OPEN_IN_TAB:
doNavigateToUrl(item.getUrl(), true);
break;
case MENU_COPY_URL:
ApplicationUtils.copyTextToClipboard(this, item.getUrl(), getString(R.string.Commons_UrlCopyToastMessage));
break;
case MENU_SHARE:
ApplicationUtils.sharePage(this, item.getTitle(), item.getUrl());
break;
case MENU_DELETE_FROM_HISTORY:
BookmarksProviderWrapper.deleteHistoryRecord(getContentResolver(), item.getId());
fillData();
break;
default:
break;
}
}
return super.onContextItemSelected(menuItem);
}
示例3: onContextItemSelected
import org.zirco.utils.ApplicationUtils; //导入方法依赖的package包/类
@Override
public boolean onContextItemSelected(MenuItem item) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
Intent i;
BookmarkItem bookmarkItem = BookmarksProviderWrapper.getStockBookmarkById(getContentResolver(), info.id);
switch (item.getItemId()) {
case MENU_OPEN_IN_TAB:
i = new Intent();
i.putExtra(Constants.EXTRA_ID_NEW_TAB, true);
if (bookmarkItem != null) {
i.putExtra(Constants.EXTRA_ID_URL, bookmarkItem.getUrl());
} else {
i.putExtra(Constants.EXTRA_ID_URL,
PreferenceManager.getDefaultSharedPreferences(BookmarksListActivity.this).getString(Constants.PREFERENCES_GENERAL_HOME_PAGE, Constants.URL_ABOUT_START));
}
if (getParent() != null) {
getParent().setResult(RESULT_OK, i);
} else {
setResult(RESULT_OK, i);
}
finish();
return true;
case MENU_EDIT_BOOKMARK:
if (bookmarkItem != null) {
i = new Intent(this, EditBookmarkActivity.class);
i.putExtra(Constants.EXTRA_ID_BOOKMARK_ID, info.id);
i.putExtra(Constants.EXTRA_ID_BOOKMARK_TITLE, bookmarkItem.getTitle());
i.putExtra(Constants.EXTRA_ID_BOOKMARK_URL, bookmarkItem.getUrl());
startActivityForResult(i, ACTIVITY_EDIT_BOOKMARK);
}
return true;
case MENU_COPY_URL:
if (bookmarkItem != null) {
ApplicationUtils.copyTextToClipboard(this, bookmarkItem.getUrl(), getString(R.string.Commons_UrlCopyToastMessage));
}
return true;
case MENU_SHARE:
if (bookmarkItem != null) {
ApplicationUtils.sharePage(this, bookmarkItem.getTitle(), bookmarkItem.getUrl());
}
return true;
case MENU_DELETE_BOOKMARK:
//mDbAdapter.deleteBookmark(info.id);
BookmarksProviderWrapper.deleteStockBookmark(getContentResolver(), info.id);
fillData();
return true;
default: return super.onContextItemSelected(item);
}
}
示例4: onContextItemSelected
import org.zirco.utils.ApplicationUtils; //导入方法依赖的package包/类
@Override
public boolean onContextItemSelected(MenuItem item) {
if ((item != null) &&
(item.getIntent() != null)) {
Bundle b = item.getIntent().getExtras();
switch(item.getItemId()) {
case CONTEXT_MENU_OPEN:
if (b != null) {
navigateToUrl(b.getString(Constants.EXTRA_ID_URL));
}
return true;
case CONTEXT_MENU_OPEN_IN_NEW_TAB:
if (b != null) {
addTab(false, mViewFlipper.getDisplayedChild());
navigateToUrl(b.getString(Constants.EXTRA_ID_URL));
}
return true;
case CONTEXT_MENU_DOWNLOAD:
if (b != null) {
doDownloadStart(b.getString(Constants.EXTRA_ID_URL), null, null, null, 0);
}
return true;
case CONTEXT_MENU_COPY:
if (b != null) {
ApplicationUtils.copyTextToClipboard(this, b.getString(Constants.EXTRA_ID_URL), getString(R.string.Commons_UrlCopyToastMessage));
}
return true;
case CONTEXT_MENU_SHARE:
if (b != null) {
ApplicationUtils.sharePage(this, "", b.getString(Constants.EXTRA_ID_URL));
}
return true;
default: return super.onContextItemSelected(item);
}
}
return super.onContextItemSelected(item);
}