You have to wait until layout happens, which is after onCreate()
. You can do so by listening to onSizeChanged()
on a View or by posting a Runnable from onCreate() (myView.post(new Runnable() { ... }))
.
More Related Contents:
- Give Scroll view to only edittext in android
- FloatingActionButton example with Support Library
- RecyclerView expand/collapse items
- Capturing mobile phone traffic on Wireshark
- How do I launch the Android emulator from the command line?
- End call in android programmatically
- android app specific soft keyboard
- Android AnimationDrawable and knowing when animation ends
- FusedLocationApi.getLastLocation always null
- Android design support library for API 28 (P) not working
- Get SSID when WIFI is connected
- How do I set ANDROID_SDK_HOME environment variable?
- Out of Memory Error ImageView issue
- multiple screen support in android [duplicate]
- Android: How to Programmatically set the size of a Layout
- Android – running a method periodically using postDelayed() call
- Android: Detect Orientation Changed
- How to animate marker in android map api V2?
- Android BroadcastReceiver within Activity
- How to programmatically trigger the touch event in android?
- Cannot call getSupportFragmentManager() from activity
- How to use Jsoup with Volley?
- Calculate text size according to width of text area
- Android ScrollView layout problem
- How do I do something when an animation finishes?
- How to show alphabetical letters on side of Android ListView
- Simplified and Traditional Chinese vs Regions
- How to prevent Android from returning a cached response to my HTTP Request?
- Undefined Reference To ‘cv::initModule_nonfree()’ In Android
- Half circle shape not work