This should be some help for you if you want to set size programmatically. Text will show in the same size on each device
TextView text = new TextView(this);
text.setText("text");
text.setTextSize(16 * getResources().getDisplayMetrics().density);
More Related Contents:
- How to calculate dp from pixels in android programmatically [duplicate]
- How to reduce the gap between navigation icon and toolbar title?
- How to create a marquee effect for a text of smaller length not exceeding the screen size in Android?
- Android Studio – Firebase Fatal error
- Can the Android layout folder contain subfolders?
- Android How to adjust layout in Full Screen Mode when softkeyboard is visible
- Set the absolute position of a view
- How do I create a ListView with rounded corners in Android?
- Android Paint: .measureText() vs .getTextBounds()
- How to avoid soft keyboard pushing up my layout? [duplicate]
- Remove icon/logo from action bar on android
- Android Custom Shape Button
- Android: Where is the Spinner widget’s text color attribute hiding?
- Cursor adapter and sqlite example [closed]
- How to limit the height of Spinner drop down view in Android
- One Activity and all other Fragments [closed]
- Align text around ImageSpan center vertical
- How to disable dates before today date in DatePickerDialog Android?
- Detect 7 inch and 10 inch tablet programmatically
- Create Custom Big Notifications
- Android – how to set background color of all screens?
- How to programmatically round corners and set random background colors
- Android – how to make a scrollable constraintlayout?
- Own defined Layout , onDraw() method not getting called
- Android AlertDialog with rounded corners
- How to overcome this item padding in navigation drawer?
- Placing ViewPager as a row in ListView
- Why Bitmap to Base64 String showing black background on webview in android?
- Android WebView Scrollable
- Why isn’t there a getContentView() method for Activity?