Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe your problem is when you are calling "getTextView();"</p> <pre><code>TextView tempTxt = getTextView(); tempTxt.setTextSize( 25 ); </code></pre> <p>Also, when you set the size of your text, you should use this to make sure they are pixels:</p> <pre><code>tempTxt.setTextSize(TypedValue.COMPLEX_UNIT_PX, 25); </code></pre> <p>Read here: <a href="https://stackoverflow.com/questions/3687065/textview-settextsize-behaves-abnormally">TextView.setTextSize behaves abnormally - How to set text size of textview dynamically for different screens</a> <a href="https://stackoverflow.com/questions/5032355/android-textview-settextsize-incorrectly-increases-text-size">Android TextView setTextSize incorrectly increases text size</a></p> <p>It is best if objects that are created have an ID from the XML by using "findViewById":</p> <pre><code>@Override public boolean onCreateOptionsMenu(Menu menu) { // Create an options menu for the activity super.onCreateOptionsMenu( menu ); MenuItem incrseTxtMenu = menu.add( 0,4,0,"Increase Text Size" ); incrseTxtMenu.setIcon( android.R.drawable.btn_plus ); incrseTxtMenu.setOnMenuItemClickListener( new MenuItem.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { TextView text = (TextView) findViewById(R.id.faq_Intro); //faq_Intro from XML tempTxt.setTextSize(TypedValue.COMPLEX_UNIT_PX, 25); //corrected return true; } }); return true; } </code></pre> <p>Also instead of using "OnMenuItemCLickListener", you can easily use "onOptionsItemSelected" with a case switch:</p> <pre><code>public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()){ case R.id.increasesize: //some code break; case R.id.exit: finish(); break; default: return true; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload