Aplikasi kamus bahasa isyarat indonesia 3
Android Mengunggah Gambar Kamera, gambar ke Server dengan Progress Bar
package com.example.coba;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
public class Imbuhan extends Activity {
Integer[]
image = {R.drawable.lebih, R.drawable.maaf, R.drawable.minum,
R.drawable.makasih, R.drawable.lebih};
String[]
name = {"Lebih","Maaf","Minum","Makasih","Suka"};
ListView
listview;
@Override
protected
void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list);
listview
= (ListView) findViewById(R.id.listview);
Custom
adapter = new Custom(Imbuhan.this, name, image);
listview.setAdapter(adapter);
listview.setOnItemClickListener(new
OnItemClickListener() {
@Override
public
void onItemClick(AdapterView<?> parent, View v, int position, long id) {
switch(position){
case 0: Intent newActivity = new Intent(Imbuhan.this,
Foto.class);
startActivity(newActivity);
break;
case 1: Intent newActivity1 = new
Intent(Imbuhan.this, Foto1.class);
startActivity(newActivity1);
break;
case 2: Intent newActivity2 = new
Intent(Imbuhan.this, Foto2.class);
startActivity(newActivity2);
break;
case 3: Intent newActivity3 = new Intent(Imbuhan.this,
Foto3.class);
startActivity(newActivity3);
break;
case 4: Intent newActivity4 = new
Intent(Imbuhan.this, Foto4.class);
startActivity(newActivity4);
}
}
@SuppressWarnings("unused")
public void onClick(View v){
};
});}
}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
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="Foto" >
<ImageView
android:id="@+id/imageview"
android:layout_width="200dp"
android:layout_height="250dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:scaleType="centerCrop"
android:src="@drawable/lebih" />
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
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="Foto" >
<ImageView
android:id="@+id/imageview"
android:layout_width="200dp"
android:layout_height="250dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:scaleType="centerCrop"
android:src="@drawable/lebih" />
</RelativeLayout>
Komentar
Posting Komentar