本文整理了Java中android.content.Intent.getCharExtra()
方法的一些代码示例,展示了Intent.getCharExtra()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Intent.getCharExtra()
方法的具体详情如下:
包路径:android.content.Intent
类名称:Intent
方法名:getCharExtra
暂无
代码示例来源:origin: TeamNewPipe/NewPipe
String location = intent.getStringExtra(EXTRA_LOCATION);
int threads = intent.getIntExtra(EXTRA_THREADS, 1);
char kind = intent.getCharExtra(EXTRA_KIND, '?');
String psName = intent.getStringExtra(EXTRA_POSTPROCESSING_NAME);
String[] psArgs = intent.getStringArrayExtra(EXTRA_POSTPROCESSING_ARGS);
代码示例来源:origin: stackoverflow.com
Intent intent = getIntent();
if (null != intent) { //Null Checking
String StrData= intent.getStringExtra(KEY);
int NoOfData = intent.getIntExtra(KEY, defaultValue);
boolean booleanData = intent.getBooleanExtra(KEY, defaultValue);
char charData = intent.getCharExtra(KEY, defaultValue);
}
代码示例来源:origin: stackoverflow.com
Intent intent = getIntent();
if (intent!=null) {
String stringData= intent.getStringExtra(KEY);
int numberData = intent.getIntExtra(KEY, defaultValue);
boolean booleanData = intent.getBooleanExtra(KEY, defaultValue);
char charData = intent.getCharExtra(KEY, defaultValue); }
代码示例来源:origin: stackoverflow.com
Intent intent = getIntent();
if (null != intent) {
MyActivity myActivity = intent.getSerializableExtra("SELECTED_ACTIVITY");
String stringData= intent.getStringExtra("KEY_STRING");
int numberData = intent.getIntExtra("KEY_INTEGER", 0);
boolean booleanData = intent.getBooleanExtra("KEY_BOOLEAN", false);
char charData = intent.getCharExtra("KEY_CHAR", 'a');
}
代码示例来源:origin: Calsign/APDE
@Override
public void onReceive(Context context, Intent intent) {
char severity = intent.getCharExtra("com.calsignlabs.apde.LogSeverity", 'o');
String message = intent.getStringExtra("com.calsignlabs.apde.LogMessage");
String exception = intent.getStringExtra("com.calsignlabs.apde.LogException");
handleSketchConsoleLog(severity, message, exception);
}
};
代码示例来源:origin: JackWHLiu/jackknife
public static char getCharExtra(Intent intent, String name, char defaultValue) {
if (intent != null || !hasExtra(intent, name)) return defaultValue;
return intent.getCharExtra(name, defaultValue);
}
代码示例来源:origin: stackoverflow.com
backBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(Pataskhan.this, MainActivity.class);
i.putExtra("hashiv", a);
setResult(5, i);
finish();
}
});
First activity
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode==5)
{
if (resultCode == RESULT_OK) {
if (data == null) {Toast.makeText(this,"Error", Toast.LENGTH_SHORT).show();}
int pat = data.getCharExtra("hashiv", hash);
int ha = 0;ha+=pat;
hashivVerj.setText(Integer.toString(ha));
}
}
}
}
代码示例来源:origin: dsolonenko/financisto
public static CsvExportOptions fromIntent(Intent data) {
WhereFilter filter = WhereFilter.fromIntent(data);
Currency currency = CurrencyExportPreferences.fromIntent(data, "csv");
char fieldSeparator = data.getCharExtra(CsvExportActivity.CSV_EXPORT_FIELD_SEPARATOR, ',');
boolean includeHeader = data.getBooleanExtra(CsvExportActivity.CSV_EXPORT_INCLUDE_HEADER, true);
boolean exportSplits = data.getBooleanExtra(CsvExportActivity.CSV_EXPORT_SPLITS, false);
boolean uploadToDropbox = data.getBooleanExtra(CsvExportActivity.CSV_EXPORT_UPLOAD_TO_DROPBOX, false);
return new CsvExportOptions(currency, fieldSeparator, includeHeader, exportSplits, uploadToDropbox, filter, true);
}
代码示例来源:origin: xiaolongonly/Ticket-Analysis
public static char getCharExtra(Intent intent, String name, char defaultValue) {
if (!hasIntent(intent) || !hasExtra(intent, name)) return defaultValue;
return intent.getCharExtra(name, defaultValue);
}
代码示例来源:origin: dsolonenko/financisto
public static CsvImportOptions fromIntent(Intent data) {
WhereFilter filter = WhereFilter.fromIntent(data);
Currency currency = CurrencyExportPreferences.fromIntent(data, "csv");
char fieldSeparator = data.getCharExtra(CsvImportActivity.CSV_IMPORT_FIELD_SEPARATOR, ',');
String dateFormat = data.getStringExtra(CsvImportActivity.CSV_IMPORT_DATE_FORMAT);
long selectedAccountId = data.getLongExtra(CsvImportActivity.CSV_IMPORT_SELECTED_ACCOUNT_2, -1);
String filename = data.getStringExtra(CsvImportActivity.CSV_IMPORT_FILENAME);
boolean useHeaderFromFile = data.getBooleanExtra(CsvImportActivity.CSV_IMPORT_USE_HEADER_FROM_FILE, true);
return new CsvImportOptions(currency, dateFormat, selectedAccountId, filter, filename, fieldSeparator, useHeaderFromFile);
}
代码示例来源:origin: Meituan-Dianping/Shield
public static char getCharParam(String name, char defaultValue, Fragment fragment) {
if (fragment.getArguments() != null && fragment.getArguments().containsKey(name)) {
return fragment.getArguments().getChar(name);
}
Intent i = fragment.getActivity().getIntent();
try {
Uri uri = i.getData();
if (uri != null) {
String val = uri.getQueryParameter(name);
if (!TextUtils.isEmpty(val))
return val.charAt(0);
}
} catch (Exception e) {
e.printStackTrace();
}
return i.getCharExtra(name, defaultValue);
}
代码示例来源:origin: TellH/AutoGo
return intent.getByteExtra(key, (Byte) defValue);
} else if ("Char".equals(type)) {
return intent.getCharExtra(key, (Character) defValue);
} else if ("String".equals(type)) {
return checkNull(intent.getStringExtra(key), defValue);
代码示例来源:origin: AmazMod/AmazMod
final char mode = intent.getCharExtra(MODE, 'N');
内容来源于网络,如有侵权,请联系作者删除!