本文整理了Java中androidx.appcompat.app.AppCompatActivity.getString()
方法的一些代码示例,展示了AppCompatActivity.getString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AppCompatActivity.getString()
方法的具体详情如下:
包路径:androidx.appcompat.app.AppCompatActivity
类名称:AppCompatActivity
方法名:getString
暂无
代码示例来源:origin: cSploit/android
public RedirectionDialog(String title, AppCompatActivity activity, final RedirectionDialogListener listener){
super(activity);
final View view = LayoutInflater.from(activity).inflate(R.layout.plugin_mitm_redirect_dialog, null);
this.setTitle(title);
this.setView(view);
this.setButton(BUTTON_POSITIVE, "Ok", new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int id){
assert view != null;
String address = ((EditText) view.findViewById(R.id.redirAddress)).getText() + "".trim(),
port = ((EditText) view.findViewById(R.id.redirPort)).getText() + "".trim();
listener.onInputEntered(address, port);
}
});
this.setButton(BUTTON_NEGATIVE, activity.getString(R.string.cancel_dialog), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
}
代码示例来源:origin: cSploit/android
this.setButton(BUTTON_NEGATIVE, activity.getString(R.string.cancel_dialog), new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int id){
dialog.dismiss();
代码示例来源:origin: proninyaroslav/libretorrent
private void updatePieceCounter()
{
String piecesTemplate = activity.getString(R.string.torrent_pieces_template);
String pieceLength = Formatter.formatFileSize(activity, pieceSize);
piecesCounter.setText(String.format(piecesTemplate, downloadedPieces, allPiecesCount, pieceLength));
}
}
代码示例来源:origin: proninyaroslav/libretorrent
return;
String speedTemplate = activity.getString(R.string.download_upload_speed_template);
String downloadSpeed = Formatter.formatFileSize(activity, basicState.downloadSpeed);
String uploadSpeed = Formatter.formatFileSize(activity, basicState.uploadSpeed);
downloadUploadSpeed.setText(String.format(speedTemplate, downloadSpeed, uploadSpeed));
String counterTemplate = activity.getString(R.string.download_counter_template);
String totalBytes = Formatter.formatFileSize(activity, basicState.totalBytes);
String receivedBytes;
textViewETA.setText(ETA);
String seedsTemplate = activity.getString(R.string.torrent_peers_template);
textViewSeeds.setText(String.format(seedsTemplate, advanceState.seeds, advanceState.totalSeeds));
String peersTemplate = activity.getString(R.string.torrent_peers_template);
int leechers = Math.abs(basicState.peers - advanceState.seeds);
int totalLeechers = basicState.totalPeers - advanceState.totalSeeds;
String piecesTemplate = activity.getString(R.string.torrent_pieces_template);
String pieceLength = Formatter.formatFileSize(activity, info.pieceLength);
textViewPieces.setText(String.format(piecesTemplate, advanceState.downloadedPieces,
代码示例来源:origin: proninyaroslav/libretorrent
if (position != -1 && position < columns.length) {
String column = columns[position];
pref.edit().putString(activity.getString(R.string.pref_key_sort_torrent_by), column).apply();
direction = TorrentSorting.Direction.DESC.name();
pref.edit().putString(activity.getString(R.string.pref_key_sort_torrent_direction), direction).apply();
if (adapter != null)
adapter.setSorting(new TorrentSortingComparator(
内容来源于网络,如有侵权,请联系作者删除!