android


android get drawable area in onCreate method


if I have a layout with fill_parent at height and width, is there a way to get his height and width in onCreate method? if not, when his dimensions are available? I need this because I need to add at runtime some views and I need to know how many views fill in the layout.
You can do that:.
Suppose you have the layout view in onCreate method
layout.post(new Runnable() {
#Override
public void run() {
height= getHeight();
width=getWidth();
//pupulate other views now that you know the parent size
}
}
});
You can use the onSizeChanged method to get the information when it has been calculated, but this may also help to at least get the dimensions of the display.
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
int width = display.getWidth();
You may find this useful:
when is onSizeChanged() called?

Related Links

speex jni wrapper so that use easy
Applying Photoshop PSD template for Android
view Pager doesn't reload its content
Can't Connect to a bluetooth device (from Phone to HC-05)
iOS & Android pt sizes unequal
Connection error when reading Android NfcV tags
how select where and like in android
how to check if user name and password are correct using AsyncTask class
How to take picture from internal storage and save capture image in internal memory android?
why can't I go for intent instead of pending intent?
android sendmessagedelayed takes too long
How to search for files in sd card with some keyword?
NullPointerException when entering video in full screen webview nokia x
Meaning of JSON Error I am getting
Value from webservice is repeating
Concurrent SQLite access in Android

Categories

HOME
google-app-engine
grok
google-cloud-platform
deep-learning
fuelux
telegram
jmeter
formal-languages
3d
apache-spark-mllib
apiblueprint
vscode-extensions
google-apps
zip
joomla3.0
sendgrid-api-v3
project-intu
rtf
scrolltop
powershell-v5.0
job-scheduling
chargify
pyramid
apache2.4
symbols
roslyn
visual-studio-extensions
roundup
expressionengine3
apktool
intersystems-cache
genexus-sd
browser-sync
uitapgesturerecognizer
classcastexception
apiary.io
google-knowledge-graph
playframework-2.1
dm-script
gdata
plaintext
portforwarding
linqpad
smoothstate.js
http-request
angular-http
show-hide
apache-spark-dataset
strftime
facebook-social-plugins
flask-restful
dynamic-linq
jboss-4.2.x
lampp
hammer.js
reportservice2010
facebook-pixel
truezip
boo
bbpress
libjpeg
reachability
greatest-n-per-group
rspec2
lua-telegram-bot
sklearn-pandas
jparsec
decimalformat
tfs-workitem
xenomai
oracle-spatial
viola-jones
keyup
zend-currency
dbaccess
execve
android-cookiemanager
uncaught-typeerror
primitive-types
administration
structuremap3
cocos3d
create.js
codeplex
paste
menubar
visual-studio-express
artemis
jammer
embedded-fonts
sqlclr
appjs
jdb
mapping-by-code
window-decoration
stress
luabind
listactivity
uipagecontrol
tmx
twitterizer
load-time
interprocess
openfaces
fdf

Resources

Encrypt Message