Skip to main content

Posts

Showing posts from October, 2012

Class cast exception

This Exception mainly occur because when we create an action on click of a button or an action to be performed on start of an activity ,but we forget the write the code in the activity for which we wrote intent to go. for example in  a main.xml file we have 7 buttons. <ScrollView  xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"         android:layout_height="fill_parent"         >     <LinearLayout         android:layout_width="fill_parent"         android:layout_height="fill_parent"         android:orientation="vertical"         android:padding="30dp" >         <TextView             android:id="@+id/textView1"             android:layout_width="wrap_content"       ...

Android ListView with Searchbox Sort items

This article is next step of List Example. Here we have a search box which sorts the list view as when the content matches the list items. Why do we need this? Imagine that if we have 2K to 3K items in the listview, It will not be possible to  scrolldown till 2000 th  item.In this case this will be handy to cut short items. To start with we add a edittext box and Listview added to LinearLayout. [sourcecode language="xml"] <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"> <EditText android:id="@+id/EditText01" android:layout_height="wrap_content" android:layout_width="fill_parent" android:hint="Search"></EditText><ListView androi...

Android Listview Example

Today, we are going to see about a simple listview example. In Android, Listview is used to show a list of items in a vertically scrolling list.  Learn a listview of android array in this tutorial. For instance, in a Registration form when we are selecting professions a list of items will be displayed. We can use Listview to display the list of items. Your XML file should look like [sourcecode language="xml"] <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <ListView android:id="@+id/ListView01" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> [/sourcecode] Your Java code looks like [sourcecode language="java"] public class List...

how create tabs in android application

use eclipse to create a project which contain tabs. *select new project ,then select new android application project  *chose the api level  i have taken 2.2 now in the layout folder go to mainpage.xml and paste this code  <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     > <TabHost     android:id="@android:id/tabhost"     android:layout_width="fill_parent"     android:layout_height="fill_parent" >     <LinearLayout         android:layout_width="fill_parent"         android:layout_height="fill_parent"         android:orientation="vertical" >          ...

versions of android

army of android Android beta Android 1.1 Android 1.5 Cupcake Android 1.6 Donut Android 2.0/2.1 Eclair Android 2.2.x Froyo Android 2.3.x Gingerbread Android 3.x Honeycomb Android 4.0.x Ice Cream Sandwich Android 4.1.x Jelly Bean