My View is not generated programmatically, but it is found with findbyid function. After getting view I like to position it properly.
To do that I am using layout function to change position of view in onCreate with given parameters. Problem is that is not working properly and view stays in top left corner.
Function works fine while using it onTouch after activity is loaded. What I am doing wrong, is there another to set view based on these four parameters that layout uses.
Edit:
Params are loaded from DB.
this is what I use in onCreate:
setContentView(R.layout.baseview);
View view=(ImageView) findViewById(R.id.blah);
int top=cursor.getInt(cursor.getColumnIndex(CallerViewDB.TOP));
int bottom=cursor.getInt(cursor.getColumnIndex(CallerViewDB.BOTTOM));
int left=cursor.getInt(cursor.getColumnIndex(CallerViewDB.LEFT));
int right=cursor.getInt(cursor.getColumnIndex(CallerViewDB.RIGHT));
view.layout(left, top, right, bottom);
Loaded values are right, checked it w sqllite browser. It seems that calling layout function in onCreate does not anything. Is there any alternative?
Ok after some reasearch this is how it is done: