List of usage examples for android.widget TextView append
public final void append(CharSequence text)
From source file:org.thomasamsler.android.flashcards.fragment.AboutFragment.java
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String version = null;//ww w . j a va 2 s .c om // Get version information from AndroidManifest.xml try { version = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0).versionName; } catch (NameNotFoundException e) { Log.w(AppConstants.LOG_TAG, "Exception accessing version information", e); } TextView versionTextView = (TextView) getActivity().findViewById(R.id.textViewAboutVersion); versionTextView.append(version); ImageButton imageButtonCancel = (ImageButton) getActivity().findViewById(R.id.imageButtonAboutClose); imageButtonCancel.setOnClickListener(new OnClickListener() { public void onClick(View v) { ((MainApplication) getActivity().getApplication()).doAction(ACTION_SHOW_CARD_SETS, Boolean.TRUE); } }); }
From source file:MainActivity.java
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_SPEECH && resultCode == RESULT_OK && data != null) { ArrayList<String> result = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS); TextView textView = (TextView) findViewById(R.id.textView); if (result.size() > 0) { textView.setText(""); for (String item : result) { textView.append(item + "\n"); }/*from w w w .j a va 2 s . c om*/ } } }
From source file:com.projectsexception.about.adapters.ColumnsAdapter.java
@Override public Object instantiateItem(View view, int position) { ViewGroup viewGroup = (ViewGroup) view; View newView;/*www. j ava 2s. c om*/ String appName = context.getString(R.string.about_app_name); if (position == 0) { newView = inflater.inflate(R.layout.about_comments, null); Button button = (Button) newView.findViewById(R.id.about_like); button.setText(context.getString(R.string.about_comments_like, appName)); String[] lines = context.getResources().getStringArray(R.array.about_comments_pro_features); if (lines.length == 0) { // No se han especificado caractersticas de la versin PRO // Suponemos por tanto que no hay versin PRO newView.findViewById(R.id.about_getpro).setVisibility(View.GONE); newView.findViewById(R.id.about_comments_pro_title).setVisibility(View.GONE); newView.findViewById(R.id.about_comments_pro_features).setVisibility(View.GONE); } else { TextView textView = (TextView) newView.findViewById(R.id.about_comments_pro_features); for (String line : lines) { textView.append(line); textView.append("\n"); } } } else if (position == 1) { newView = inflater.inflate(R.layout.about_contact, null); TextView textView = (TextView) newView.findViewById(R.id.about_contact_title); textView.setText(appName); textView = (TextView) newView.findViewById(R.id.about_contact_license_content); new LicenseTask(context).execute(textView); } else { newView = inflater.inflate(R.layout.about_apps, null); ListView listView = (ListView) newView.findViewById(android.R.id.list); ApplicationsAdapter adapter = new ApplicationsAdapter(context); listView.setAdapter(adapter); new AppsTask(context).execute(adapter); } viewGroup.addView(newView); return newView; }
From source file:com.wbs.itm.SelectedQuestionActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.all_ans);/*w w w. ja v a 2 s . co m*/ selquesList = new ArrayList<HashMap<String, String>>(); Intent newqestionintent = getIntent(); String newquestion = newqestionintent.getExtras().getString("TAG_QUESTION"); new LoadAllSelques().execute(); TextView text = (TextView) findViewById(R.id.selectedquestion); text.setText("Q. "); text.append(newquestion); ListView lv = getListView(); Button gohome = (Button) findViewById(R.id.gohome); gohome.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent i = new Intent(getApplicationContext(), TalkyLaunchActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(i); } }); Button ansbtn = (Button) findViewById(R.id.ansbtn); ansbtn.setOnClickListener(new Button.OnClickListener() { @Override public void onClick(View v) { newqintent = getIntent(); newqid = newqintent.getExtras().getString("TAG_PID"); /*String newpid = ((TextView) findViewById(R.id.qid)).getText() .toString();*/ Intent mynewIntent = new Intent(SelectedQuestionActivity.this, NewAnswerActivity.class); mynewIntent.putExtra("TAG_newPID", newqid); SelectedQuestionActivity.this.startActivity(mynewIntent); } }); lv.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // getting values from selected ListItem // Do nothing! //Later on implement selective Replies. } }); }
From source file:com.coincide.alphafitness.ui.Activity_Main.java
public boolean optionsItemSelected(final MenuItem item) { switch (item.getItemId()) { case android.R.id.home: getFragmentManager().popBackStackImmediate(); break;/* w w w. j a v a 2 s . co m*/ case R.id.action_settings: getFragmentManager().beginTransaction().replace(android.R.id.content, new Fragment_Settings()) .addToBackStack(null).commit(); break; case R.id.action_leaderboard: case R.id.action_achievements: AlertDialog.Builder builder2 = new AlertDialog.Builder(this); builder2.setTitle("Google services required"); builder2.setMessage("This feature is not available on the F-Droid version of the app"); builder2.setNegativeButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); builder2.create().show(); break; case R.id.action_faq: startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://j4velin.de/faq/index.php?app=pm")) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); break; case R.id.action_about: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.about); TextView tv = new TextView(this); tv.setPadding(10, 10, 10, 10); tv.setText(R.string.about_text_links); try { tv.append(getString(R.string.about_app_version, getPackageManager().getPackageInfo(getPackageName(), 0).versionName)); } catch (NameNotFoundException e1) { // should not happen as the app is definitely installed when // seeing the dialog e1.printStackTrace(); } tv.setMovementMethod(LinkMovementMethod.getInstance()); builder.setView(tv); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(final DialogInterface dialog, int which) { dialog.dismiss(); } }); builder.create().show(); break; } return true; }
From source file:com.pedometrak.ui.ActivityMain.java
public boolean handleItemSelected(final MenuItem item) { switch (item.getItemId()) { case android.R.id.home: getFragmentManager().popBackStackImmediate(); break;/*from ww w . j a v a2 s. c om*/ case R.id.action_settings: getFragmentManager().beginTransaction().replace(android.R.id.content, new FragmentSettings()) .addToBackStack(null).commit(); break; case R.id.action_about: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.about); TextView tv = new TextView(this); tv.setPadding(30, 30, 30, 30); tv.setText(R.string.about_text_links); try { tv.append(getString(R.string.about_app_version, getPackageManager().getPackageInfo(getPackageName(), 0).versionName)); } catch (NameNotFoundException e1) { // should not happen as the app is definitely installed when // seeing the dialog e1.printStackTrace(); } tv.setMovementMethod(LinkMovementMethod.getInstance()); builder.setView(tv); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(final DialogInterface dialog, int which) { dialog.dismiss(); } }); builder.create().show(); break; } return true; }
From source file:com.color.kid.kidpaint.dialog.DialogAbout.java
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override// ww w . j ava2 s . c o m public Dialog onCreateDialog(Bundle savedInstanceState) { LayoutInflater inflater = getActivity().getLayoutInflater(); AlertDialog.Builder builder = new CustomAlertDialogBuilder(getActivity()); builder.setTitle(R.string.about_title); View view = inflater.inflate(R.layout.dialog_about, null); TextView aboutVersionNameTextView = (TextView) view.findViewById(R.id.dialog_about_version_name_text_view); String versionName = PaintroidApplication.getVersionName(getActivity()); aboutVersionNameTextView.setText(R.string.about_version); aboutVersionNameTextView.append(" " + versionName); TextView aboutTextView = (TextView) view.findViewById(R.id.about_tview_Text); String aboutText = String.format(getActivity().getString(R.string.about_content), getActivity().getString(R.string.license_type_paintroid)); aboutTextView.setText(aboutText); TextView aboutUrlTextView = (TextView) view.findViewById(R.id.about_tview_Url); aboutUrlTextView.setMovementMethod(LinkMovementMethod.getInstance()); Resources resources = getActivity().getResources(); /*String paintroidLicense = String.format( resources.getString(R.string.about_link_template), resources.getString(R.string.license_url), resources.getString(R.string.about_license_url_text)); aboutUrlTextView.append(Html.fromHtml(paintroidLicense)); aboutUrlTextView.append("\n\n"); String aboutCatroid = String.format( resources.getString(R.string.about_link_template), resources.getString(R.string.catroid_url), resources.getString(R.string.about_catroid_url_text));*/ //aboutUrlTextView.append(Html.fromHtml(aboutCatroid)); aboutUrlTextView.append("\n"); builder.setView(view); builder.setNeutralButton(R.string.done, this); return builder.create(); }
From source file:org.catrobat.paintroid.dialog.DialogAbout.java
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override/*from ww w . ja va 2 s.c o m*/ public Dialog onCreateDialog(Bundle savedInstanceState) { LayoutInflater inflater = getActivity().getLayoutInflater(); AlertDialog.Builder builder; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { builder = new AlertDialog.Builder(getActivity()); } else { builder = new AlertDialog.Builder(getActivity(), AlertDialog.THEME_HOLO_DARK); } builder.setTitle(R.string.about_title); View view = inflater.inflate(R.layout.dialog_about, null); TextView aboutVersionNameTextView = (TextView) view.findViewById(R.id.dialog_about_version_name_text_view); String versionName = PaintroidApplication.getVersionName(getActivity()); aboutVersionNameTextView.setText(R.string.about_version); aboutVersionNameTextView.append(" " + versionName); TextView aboutTextView = (TextView) view.findViewById(R.id.about_tview_Text); String aboutText = String.format(getActivity().getString(R.string.about_content), getActivity().getString(R.string.licence_type_paintroid)); aboutTextView.setText(aboutText); TextView aboutUrlTextView = (TextView) view.findViewById(R.id.about_tview_Url); aboutUrlTextView.setMovementMethod(LinkMovementMethod.getInstance()); Resources resources = getActivity().getResources(); String paintroidLicence = String.format(resources.getString(R.string.about_link_template), resources.getString(R.string.license_url), resources.getString(R.string.about_licence_url_text)); aboutUrlTextView.append(Html.fromHtml(paintroidLicence)); aboutUrlTextView.append("\n\n"); String aboutCatroid = String.format(resources.getString(R.string.about_link_template), resources.getString(R.string.catroid_url), resources.getString(R.string.about_catroid_url_text)); aboutUrlTextView.append(Html.fromHtml(aboutCatroid)); aboutUrlTextView.append("\n"); builder.setView(view); builder.setNeutralButton(R.string.done, this); return builder.create(); }
From source file:net.yolosec.upckeygen.ui.AboutTabHostActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.about_dialog); try {/*from ww w . jav a 2 s.com*/ getSupportActionBar().setDisplayHomeAsUpEnabled(true); } catch (Exception e) { Log.e(TAG, "Exception", e); } TabHost tabs = (TabHost) findViewById(R.id.tabhost); tabs.setup(); TabHost.TabSpec tspec1 = tabs.newTabSpec("about"); tspec1.setIndicator(getString(R.string.pref_2section)); tspec1.setContent(R.id.text_about_scroll); TextView text = ((TextView) findViewById(R.id.text_about)); text.setMovementMethod(LinkMovementMethod.getInstance()); try { PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0); String version = pInfo.versionName; text.append(version); } catch (Exception e) { Log.e(TAG, "Exception in getting app version", e); } tabs.addTab(tspec1); TabHost.TabSpec tspec2 = tabs.newTabSpec("credits"); tspec2.setIndicator(getString(R.string.dialog_about_credits)); tspec2.setContent(R.id.about_credits_scroll); ((TextView) findViewById(R.id.about_credits)).setMovementMethod(LinkMovementMethod.getInstance()); tabs.addTab(tspec2); TabHost.TabSpec tspec3 = tabs.newTabSpec("license"); tspec3.setIndicator(getString(R.string.dialog_about_license)); tspec3.setContent(R.id.about_license_scroll); ((TextView) findViewById(R.id.about_license)).setMovementMethod(LinkMovementMethod.getInstance()); tabs.addTab(tspec3); }
From source file:de.j4velin.pedometer.ui.Activity_Main.java
public boolean optionsItemSelected(final MenuItem item) { switch (item.getItemId()) { case android.R.id.home: getFragmentManager().popBackStackImmediate(); break;/*from www .ja v a 2s .com*/ case R.id.action_settings: getFragmentManager().beginTransaction().replace(android.R.id.content, new Fragment_Settings()) .addToBackStack(null).commit(); break; case R.id.action_leaderboard: case R.id.action_achievements: if (mGoogleApiClient.isConnected()) { startActivityForResult(item.getItemId() == R.id.action_achievements ? Games.Achievements.getAchievementsIntent(mGoogleApiClient) : Games.Leaderboards.getAllLeaderboardsIntent(mGoogleApiClient), RC_LEADERBOARDS); } else { AlertDialog.Builder builder2 = new AlertDialog.Builder(this); builder2.setTitle(R.string.sign_in_necessary); builder2.setMessage(R.string.please_sign_in_with_your_google_account); builder2.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); getFragmentManager().beginTransaction() .replace(android.R.id.content, new Fragment_Settings()).addToBackStack(null) .commit(); } }); builder2.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); builder2.create().show(); } break; case R.id.action_faq: startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://j4velin.de/faq/index.php?app=pm")) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); break; case R.id.action_about: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.about); TextView tv = new TextView(this); tv.setPadding(10, 10, 10, 10); tv.setText(R.string.about_text_links); try { tv.append(getString(R.string.about_app_version, getPackageManager().getPackageInfo(getPackageName(), 0).versionName)); } catch (NameNotFoundException e1) { // should not happen as the app is definitely installed when // seeing the dialog e1.printStackTrace(); } tv.setMovementMethod(LinkMovementMethod.getInstance()); builder.setView(tv); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(final DialogInterface dialog, int which) { dialog.dismiss(); } }); builder.create().show(); break; } return true; }