List of usage examples for android.widget TextView setText
@android.view.RemotableViewMethod public final void setText(@StringRes int resid)
From source file:com.jdom.word.playdough.android.GamePackPlayerActivity.java
public void setRunningWord(String runningWord) { TextView runningWordView = (TextView) findViewById(R.id.running_word); runningWordView.setText(runningWord); }
From source file:com.koushikdutta.desktopsms.BuyActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { //requestWindowFeature(Window.FEATURE_NO_TITLE); requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); super.onCreate(savedInstanceState); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.buy_title); TextView tv = (TextView) findViewById(R.id.title); tv.setText(R.string.desksms_one_year_license); final ClockworkModBillingClient client = ClockworkModBillingClient.getInstance(); final JSONObject data = new JSONObject(); try {//ww w. j av a 2 s .c o m data.put("device_id", Helper.getSafeDeviceId(this)); data.put("account", mSettings.getString("account")); } catch (JSONException e) { e.printStackTrace(); } ListItem status = addItem(R.string.account_status, new ListItem(this, R.string.account_status, 0)); ListItem paypal = addItem(R.string.payment_options, new ListItem(this, R.string.paypal, 0, R.drawable.paypal) { @Override public void onClick(View view) { super.onClick(view); client.startPurchase(BuyActivity.this, "desksms.subscription0", mBuyerId, mSettings.getString("account"), data.toString(), PurchaseType.PAYPAL, BuyActivity.this); } }); ListItem market = addItem(R.string.payment_options, new ListItem(this, R.string.android_market_inapp, 0, R.drawable.market) { @Override public void onClick(View view) { super.onClick(view); client.startPurchase(BuyActivity.this, "desksms.subscription0", mBuyerId, mSettings.getString("account"), data.toString(), PurchaseType.MARKET_INAPP, BuyActivity.this); } }); ListItem redeem = addItem(R.string.payment_options, new ListItem(this, R.string.redeem_code, 0, R.drawable.icon) { @Override public void onClick(View view) { super.onClick(view); client.startPurchase(BuyActivity.this, "desksms.subscription0", mBuyerId, mSettings.getString("account"), data.toString(), PurchaseType.REDEEM, BuyActivity.this); } }); JSONObject payload; try { payload = new JSONObject(getIntent().getStringExtra("payload")); mBuyerId = payload.getString("buyer_id"); long expiration = payload.getLong("subscription_expiration"); long daysLeft = (expiration - System.currentTimeMillis()) / 1000L / 60L / 60L / 24L; status.setTitle(getString(R.string.days_left, String.valueOf(daysLeft))); } catch (Exception ex) { ex.printStackTrace(); finish(); } }
From source file:MainAdapter.java
@Override public void onBindViewHolder(final MainViewHolder holder, final int position) { ImageView imageIcon = holder.imageIcon; TextView textName = holder.textName; TextView textInfo = holder.textInfo; imageIcon.setImageResource(mainData.get(position).getImage()); textName.setText(mainData.get(position).getName()); textInfo.setText(mainData.get(position).getInfo()); }
From source file:com.rampgreen.caretakermobile.ui.LegalTerms.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); userid = this.getIntent().getStringExtra("userid"); UserName = this.getIntent().getStringExtra("UserName"); setTitle(UserName);/*www. j a v a 2 s . co m*/ setContentView(R.layout.legal_terms); TextView tv1 = (TextView) this.findViewById(R.id.TVlegalterms); tv1.setText(Html.fromHtml("<h2 style = \"align:center; vertical-align:middle;\">" + " Legal Terms</h2><br><p>This web page represents a legal document that serves as our Terms of Service and it governs the legal terms of our website, http://androidexample.com, sub-domains, and any associated web-based and mobile applications (collectively, Website), as owned and operated by AndroidExample.Capitalized terms, unless otherwise defined, have the meaning specified within the Definitions section below. This Terms of Service, along with our Privacy Policy, any mobile license agreement, and other posted guidelines within our Website, collectively Legal Terms, constitute the entire and only agreement between you and AndroidExample, and supersede all other agreements, representations, warranties and understandings with respect to our Website and the subject matter contained herein. We may amend our Legal Terms at any time without specific notice to you. The latest copies of our Legal Terms will be posted on our Website, and you should review all Legal Terms prior to using our Website. After any revisions to our Legal Terms are posted, you agree to be bound to any such changes to them. Therefore, it is important for you to periodically review our Legal Terms to make sure you still agree to them. By using our Website, you agree to fully comply with and be bound by our Legal Terms. Please review them carefully. If you do not accept our Legal Terms, do not access and use our Website. If you have already accessed our Website and do not accept our Legal Terms, you should immediately discontinue use of our Website.</p>")); Button btnAgree = (Button) this.findViewById(R.id.btnAgree); btnAgree.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { // if every field is valid, send request to RTNeuroserver response_accept(token, userid); finish(); } }); }
From source file:com.jdom.word.playdough.android.GamePackPlayerActivity.java
public void setWordsFoundDisplay(String wordsFoundText) { TextView wordsFoundView = (TextView) findViewById(R.id.words_found_count); wordsFoundView.setText(wordsFoundText); }
From source file:com.liquid.wallpapers.free.core.favourites.FavouriteListAdapter.java
@Override public View getView(int position, View convertView, ViewGroup parent) { Favourite favourite = this.favourites.get(position); if (convertView == null) { convertView = LayoutInflater.from(this.context).inflate(R.layout.favourite, null); }/*w w w. ja va 2 s .c o m*/ TextView textView = (TextView) convertView.findViewById(R.id.favouriteTextBox); textView.setText(favourite.getWallpaper().getTitle()); ImageView imageView = (ImageView) convertView.findViewById(R.id.favouriteImageView); try { imageView.setImageBitmap(this.wallpaperManager.getThumbImage(favourite.getWallpaper())); } catch (ClientProtocolException ex) { AlertDialogFactory.showErrorMessage(this.context, R.string.errorText, R.string.downloadException); } catch (IOException ex) { AlertDialogFactory.showErrorMessage(this.context, R.string.errorText, R.string.downloadException); } return convertView; }
From source file:edu.berkeley.boinc.adapter.NoticesListAdapter.java
@Override public View getView(int position, View convertView, ViewGroup parent) { final Notice listItem = entries.get(position); LayoutInflater vi = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = vi.inflate(R.layout.notices_layout_listitem, null); ImageView ivIcon = (ImageView) v.findViewById(R.id.projectIcon); Bitmap icon = getIcon(position);/* www.j a v a 2 s.c o m*/ // if available set icon, if not boinc logo if (icon == null) { ivIcon.setImageDrawable(getContext().getResources().getDrawable(R.drawable.boinc)); } else { ivIcon.setImageBitmap(icon); } TextView tvProjectName = (TextView) v.findViewById(R.id.projectName); tvProjectName.setText(listItem.project_name); TextView tvNoticeTitle = (TextView) v.findViewById(R.id.noticeTitle); tvNoticeTitle.setText(listItem.title); TextView tvNoticeContent = (TextView) v.findViewById(R.id.noticeContent); tvNoticeContent.setText(Html.fromHtml(listItem.description)); TextView tvNoticeTime = (TextView) v.findViewById(R.id.noticeTime); tvNoticeTime.setText(DateUtils.formatDate(new java.util.Date((long) listItem.create_time * 1000))); v.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (Logging.DEBUG) Log.d(Logging.TAG, "noticeClick: " + listItem.link); if (listItem.link != null && !listItem.link.isEmpty()) { Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(listItem.link)); activity.startActivity(i); } } }); return v; }
From source file:com.mikecorrigan.trainscorekeeper.ActivityNewGame.java
private void addContent() { Log.vc(VERBOSE, TAG, "addContent"); LinearLayout linearLayout = (LinearLayout) findViewById(R.id.linear_layout); Resources res = getResources(); AssetManager am = res.getAssets();/* w w w .java2 s .c o m*/ String files[]; try { files = am.list(ASSETS_BASE); if (files == null || files.length == 0) { Log.e(TAG, "addContent: empty asset list"); return; } for (final String file : files) { final String path = ASSETS_BASE + File.separator + file; JSONObject jsonRoot = JsonUtils.readFromAssets(this /* context */, path); if (jsonRoot == null) { Log.e(file, "addContent: failed to read read asset"); continue; } final String name = jsonRoot.optString(JsonSpec.ROOT_NAME); if (TextUtils.isEmpty(name)) { Log.e(file, "addContent: failed to read asset name"); continue; } final String description = jsonRoot.optString(JsonSpec.ROOT_DESCRIPTION, name); TextView textView = new TextView(this /* context */); textView.setText(name); linearLayout.addView(textView); Button button = new Button(this /* context */); button.setText(description); button.setOnClickListener(new OnRulesClickListener(path)); linearLayout.addView(button); } } catch (IOException e) { Log.th(TAG, e, "addContent: asset list failed"); } }
From source file:nl.meta.mobile.chat.MobileChatActivity.java
/** * This method adds a new TextView with the message to the chatbox. * //w ww . jav a 2s. c o m * @param message * The message to be added. */ private void addMessageToChat(String message) { TextView tv = new TextView(this); tv.setText(message); llMessages.addView(tv); // Scroll to the end svMessages.fullScroll(View.FOCUS_DOWN); }
From source file:com.ibm.mobileclientaccess.clientsdk.gauth.MainActivity.java
@Override public void onSuccess(Response response) { final TextView tmpInfo = this.infoTextView; runOnUiThread(new Runnable() { @Override/* w w w .ja v a 2s. com*/ public void run() { tmpInfo.setText("Connected to Google - OK"); } }); }