Android 如何从toast上的xml中获取字符串
如何从吐司中的xml中获取字符串 像 像这样:Android 如何从toast上的xml中获取字符串,android,string,android-toast,Android,String,Android Toast,如何从吐司中的xml中获取字符串 像 像这样: Toast.makeText(getApplicationContext(), getString(R.string.Pic_taken), Toast.LENGTH_SHORT).show(); 像这样: Toast.makeText(getApplicationContext(), getString(R.string.Pic_taken), Toast.LENGTH_SHORT).show(); 只需使用Toast API: 公共静态To
Toast.makeText(getApplicationContext(), getString(R.string.Pic_taken), Toast.LENGTH_SHORT).show();
像这样:
Toast.makeText(getApplicationContext(), getString(R.string.Pic_taken), Toast.LENGTH_SHORT).show();
只需使用Toast API: 公共静态Toast makeText(上下文上下文,@StringRes int resd,@Duration int Duration)
只需使用Toast API: 公共静态Toast makeText(上下文上下文,@StringRes int resd,@Duration int Duration) 格式:
Toast.makeText(Context context, @StringRes int resId, @Duration int duration);
因此,对于您的情况,代码将是:
格式:
Toast.makeText(Context context, @StringRes int resId, @Duration int duration);
因此,对于您的情况,代码将是:
Toast.makeText(Context context, @StringRes int resId, @Duration int duration);
Toast.makeText(getApplicationContext(), R.string.Pic_taken, Toast.LENGTH_SHORT).show();