Thursday, 12 February 2015

Android Intent

An Intent is a messaging object which provides a facility for performing late runtime binding between the code in different applications in the Android development environment. Its most significant use is in the launching of activities,

An Intent is basically a passive data structure holding an abstract description of an action to be performed.


A passive data structure (opposite of active data structure, or functional data structure) is one that is managed exclusively by external threads. That is to say, it does not have some associated thread which performs operations on it.

Basically, it's like a container of information; you create it, set all its information, and it just exists to be accessed by other processes (in Android, Activity objects, usually). Hence, it is not actively being access (so it's not "active"), and it is not being operated on (not "functional"), so it should be considered passive.

Saturday, 24 August 2013

Android ExpandableListView with GridView

Step are: 1
Crete 3 xml file  a) list_items_column.xml

android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="@+id/rl_row_layout_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/tv_heading"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:background="#E5EAF5"
android:gravity="center_vertical"
android:textStyle="bold" >

b) Expandable child is row_grid.xml


android:id="@+id/gridView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:columnWidth="80dp"
android:gravity="center"
android:numColumns="auto_fit"
android:stretchMode="columnWidth" >

3.Now the Last xml is grid childern.xml

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp" >
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test"
android:layout_marginTop="15sp"
android:textSize="15sp" >


2 Step... In expandable list Adapter get Child View U can add following code.....
if (convertView == null) {
convertView = mInflater.inflate(R.layout.list_item_grid_row, null);
}
GridView label = (GridView) convertView.findViewById(R.id.gridView);
int totalHeight=0;
for (int size = 0; size < adapter.getCount(); size++) {
RelativeLayout relativeLayout = (RelativeLayout) adapter.getView(size, null,
label);
TextView textView = (TextView) relativeLayout.getChildAt(0);
textView.measure(0, 0);
totalHeight += textView.getMeasuredHeight();
}
ViewGroup.LayoutParams params = (ViewGroup.LayoutParams)label.getLayoutParams();
if (params != null)
{
params.height = totalHeight;
}
return convertView;
}