本文整理汇总了Java中android.os.Bundle.putString方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.putString方法的具体用法?Java Bundle.putString怎么用?Java Bundle.putString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Bundle
的用法示例。
在下文中一共展示了Bundle.putString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fun_openImage
import android.os.Bundle; //导入方法依赖的package包/类
@JavascriptInterface
public void fun_openImage(String jsonString) {
JSInBean jsInBean = JSBridgeUtil.getInstance().parseJsonArray(jsonString);
try {
int options = (int) (new JSONObject(jsInBean.getName()).getDouble("scale") * 100.0d);
if (this.activityHandler != null) {
Message message = new Message();
message.what = 3;
message.obj = Integer.valueOf(options);
Bundle bundle = new Bundle();
bundle.putString(a.c, jsInBean.getCallback());
bundle.putString("callback_id", jsInBean.getCallback_id());
message.setData(bundle);
this.activityHandler.sendMessage(message);
}
} catch (JSONException e) {
e.printStackTrace();
}
android.content.Intent intent = new android.content.Intent("android.intent.action.PICK");
intent.setType("image/*");
this.mActivity.startActivityForResult(intent, 10002);
}
示例2: onCreate
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_product_profile);
ButterKnife.bind(this);
if (savedInstanceState == null) {
ProductSoldFragmentProfile fragment = new ProductSoldFragmentProfile();
Bundle args = new Bundle();
Bundle extras = getIntent().getExtras();
System.out.println(getIntent().getStringExtra(ViMarket.seller_ID));
args.putString(ViMarket.seller_ID, getIntent().getStringExtra(ViMarket.seller_ID));
fragment.setArguments(args);
getSupportFragmentManager().beginTransaction().replace(R.id.product_profile_container, fragment).commit();
}
Intent returnIntent = new Intent();
setResult(Activity.RESULT_CANCELED, returnIntent);
}
示例3: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
/**
* Taking or choosing a picture launches another Activity, so we need to implement the
* save/restore APIs to handle the case where the CordovaActivity is killed by the OS
* before we get the launched Activity's result.
*/
public Bundle onSaveInstanceState() {
Bundle state = new Bundle();
state.putInt("destType", this.destType);
state.putInt("srcType", this.srcType);
state.putInt("mQuality", this.mQuality);
state.putInt("targetWidth", this.targetWidth);
state.putInt("targetHeight", this.targetHeight);
state.putInt("encodingType", this.encodingType);
state.putInt("mediaType", this.mediaType);
state.putInt("numPics", this.numPics);
state.putBoolean("allowEdit", this.allowEdit);
state.putBoolean("correctOrientation", this.correctOrientation);
state.putBoolean("saveToPhotoAlbum", this.saveToPhotoAlbum);
if (this.croppedUri != null) {
state.putString("croppedUri", this.croppedUri.toString());
}
if (this.imageUri != null) {
state.putString("imageUri", this.imageUri.getFileUri().toString());
}
return state;
}
示例4: handleMessage
import android.os.Bundle; //导入方法依赖的package包/类
public void handleMessage(Message msg) {
HiBangUser user = ((SLoginMsg)msg.obj).getUser();
if (user.getUserID() == -1) {
//MyToast.ShowMessage(LoginActivity.this, "登录失败,账号或密码错误");
showCustomToast("登录失败,账号或密码错误");
closeLoadingDialog();
} else if(user.getUserID() == -2) {
// MyToast.ShowMessage(LoginActivity.this, "登录失败,重复登录!");
showCustomToast("登录失败,重复登录!");
closeLoadingDialog();
}
else {
//MyToast.ShowMessage(LoginActivity.this, "登陆成功" );
showCustomToast("登陆成功!");
closeLoadingDialog();
application.setUser(user);
String psd = mEtPwd.getText().toString();
application.getHiBang().storeAccessToken(user, psd, String.valueOf(user.hashCode()), System.currentTimeMillis()+7*24*60*60*1000);
Intent intent = new Intent(LoginActivity.this,MainTabActivity.class);
Bundle bundle = new Bundle();
bundle.putString("className", MessageActivity.class.getName());
intent.putExtras(bundle);
LoginActivity.this.startActivity(intent);
LoginActivity.this.finish();
}
}
示例5: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onSaveInstanceState(final Bundle outState) {
super.onSaveInstanceState(outState);
final FragmentManager fm = getFragmentManager();
if (fm.findFragmentByTag(CurrentFeedFragment.TAG) != null) {
outState.putString(KEY_FRAGMENT_TAG, CurrentFeedFragment.TAG);
} else if (fm.findFragmentByTag(FeedSubscriptionsFragment.TAG) != null) {
outState.putString(KEY_FRAGMENT_TAG, FeedSubscriptionsFragment.TAG);
} else if (fm.findFragmentByTag(SavedEntriesFragment.TAG) != null) {
outState.putString(KEY_FRAGMENT_TAG, SavedEntriesFragment.TAG);
} else if (fm.findFragmentByTag(InitialSetupFragment.TAG) != null) {
outState.putString(KEY_FRAGMENT_TAG, InitialSetupFragment.TAG);
} else if (fm.findFragmentByTag(LoadCurrentFeedFragment.TAG) != null) {
outState.putString(KEY_FRAGMENT_TAG, LoadCurrentFeedFragment.TAG);
}
if (mActionMode != null) {
mActionMode.finish();
}
}
示例6: startSaveImageDialogFragment
import android.os.Bundle; //导入方法依赖的package包/类
private void startSaveImageDialogFragment() {
SaveImageDialogFragment dialog = new SaveImageDialogFragment();
Bundle bundle = new Bundle();
bundle.putString(Constants.ARG_URL, mUrl);
dialog.setArguments(bundle);
dialog.show(getSupportFragmentManager(), null);
}
示例7: PublishLikeRequestWrapper
import android.os.Bundle; //导入方法依赖的package包/类
PublishLikeRequestWrapper(String objectId, LikeView.ObjectType objectType) {
super(objectId, objectType);
Bundle likeRequestParams = new Bundle();
likeRequestParams.putString("object", objectId);
setRequest(new GraphRequest(
AccessToken.getCurrentAccessToken(),
"me/og.likes",
likeRequestParams,
HttpMethod.POST));
}
示例8: onStartSubScreen
import android.os.Bundle; //导入方法依赖的package包/类
protected void onStartSubScreen(PreferenceScreen preferenceScreen)
{
Bundle args = new Bundle();
args.putString(PreferenceFragmentCompat.ARG_PREFERENCE_ROOT, preferenceScreen.getKey());
args.putString(ConstantsUI.PREF_SCREEN_TITLE, preferenceScreen.getTitle().toString());
replaceSettingsFragment(args);
}
示例9: newInstance
import android.os.Bundle; //导入方法依赖的package包/类
public static DownloadDialog newInstance(String url) {
DownloadDialog dialog = new DownloadDialog();
Bundle bundle = new Bundle();
bundle.putString(EXTRA_URL, url);
dialog.setArguments(bundle);
return dialog;
}
示例10: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
/**
* Parcelable interface: procedure writes the formula state
*/
@Override
@SuppressLint("MissingSuperCall")
public Parcelable onSaveInstanceState()
{
Bundle bundle = new Bundle();
bundle.putString(STATE_IMAGE_TYPE, imageType.toString());
switch (imageType)
{
case NONE:
// nothing to do
break;
case BITMAP:
if (bitmap != null)
{
bundle.putParcelable(STATE_IMAGE_BITMAP, bitmap);
}
break;
case SVG:
if (svgData != null)
{
bundle.putString(STATE_IMAGE_SVG, svgData);
}
break;
}
return bundle;
}
示例11: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onSaveInstanceState(Bundle outState) {
TextView textViewDate = (TextView) findViewById(R.id.textview_date);
super.onSaveInstanceState(outState);
outState.putBoolean(KEY_INPUT_HELP_OPEN, isInputHelpPopupOpen);
outState.putBoolean(KEY_MEAT_MODIFIED, isMeatModified);
outState.putBoolean(KEY_SUBMIT_DATA_ENABLED, isSubmitDataEnabled);
outState.putString(KEY_DATE, textViewDate.getText().toString());
outState.putInt(KEY_WEIGHT, weightSelected);
}
示例12: newInstance
import android.os.Bundle; //导入方法依赖的package包/类
/**
*/
public static FileListFragment newInstance(String param1, String param2) {
FileListFragment fragment = new FileListFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
示例13: onSaveInstanceState
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putBoolean("restore", true);
outState.putString("mTitleText", mTitleText);
}
示例14: newInstance
import android.os.Bundle; //导入方法依赖的package包/类
public static ImageDetailFragment newInstance(String imageUrl) {
final ImageDetailFragment f = new ImageDetailFragment();
final Bundle args = new Bundle();
args.putString("url", imageUrl);
f.setArguments(args);
return f;
}
示例15: newInstance
import android.os.Bundle; //导入方法依赖的package包/类
public static ErrorDialog newInstance(String message) {
ErrorDialog dialog = new ErrorDialog();
Bundle args = new Bundle();
args.putString(ARG_MESSAGE, message);
dialog.setArguments(args);
return dialog;
}