Skip to main content

Posts

Showing posts with the label JAVA

Action Bar with Back press Enabled Button

Action bar With Back Press Enabled Button There are only three things we need to do, to achieve this objective.    Create action Bar with back button    Coding on Back button       And few changes in Manifest file 1.      Create action Bar with Button: In OnCreate() method write below given lines: getActionBar().setDisplayHomeAsUpEnabled(true);

ListView Example in Android

To create a simple listview in android as shown in below image, we generally need three things. 1. ListView 2. ArrayAdapter 3. Simple String array. Image 1 activity_main.xml

DropDown List in Android using Spinner

Usually we use drop down list in forms. In android we could achieve this using Spinner. Here goes the Code: activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/LinearLayout1"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     android:paddingBottom="@dimen/activity_vertical_margin"     android:paddingLeft="@dimen/activity_horizontal_margin"     android:paddingRight="@dimen/activity_horizontal_margin"     android:paddingTop="@dimen/activity_vertical_margin"     tools:context=".MainActivity" >

SET ENVIRONMENT VARIABLES FOR JAVA INSTALLATION

Goto MyComputer ->> Properties ->> Advanced System Settings->> Enviornment Variables After that In user variable Make a folder Named JAVA_HOME  and set its value: C:\Program Files\Java\jdk1.7.0_45\lib and click ok if that doesn't work try this: In user Variable, click on new at bottom of tab give JAVA_HOME in variable name in value : \ProgramFiles\java\jdkk1.8.0_05