My widget layout is defined in a file called main.xml. In this I put in a vertically orientated LinearLayout ID'd as tableRowContainer.
I then added a row.xml layout definition. This only contains another linear layout, ID'd as tableColContainer.
I furthermore added a col.xml layout definition that contains a TextView with a pre-defined text field.
In the function that updates I then tried the following--
RemoteViews remoteViews = new RemoteViews( context.getPackageName(), R.layout.main );
for ( int r=0; r<numRows; r++ ) {
RemoteViews newRow = new RemoteViews( context.getPackageName(), R.layout.row );
for ( int c=0; c<numCols; c++ ) {
RemoteViews newCol = new RemoteViews( context.getPackageName(); r.layout.col );
newRow.addView( R.id.tableColContainer, newCol );
}
remoteViews.addView( r.id.tableRowContainer, newRow );
}
and my test case works as expected!
Just need to modify it to display the real table data now.
-- You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
No comments:
Post a Comment