androidx.appcompat.app.AppCompatActivity.getString()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中androidx.appcompat.app.AppCompatActivity.getString()方法的一些代码示例,展示了AppCompatActivity.getString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AppCompatActivity.getString()方法的具体详情如下:
包路径:androidx.appcompat.app.AppCompatActivity
类名称:AppCompatActivity
方法名:getString

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(

相关文章

微信公众号

最新文章

更多

AppCompatActivity类方法