Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- Spring
- Graphic
- JavaScript
- 메서드
- Java
- Eclips
- 어노테이션
- 오버로딩
- 전화걸기
- mybatis
- 에러페이지
- 메소드
- paint
- Menu
- OGNL
- 기본
- HTML
- Android
- layout
- struts2
- JSP
- 국제화
- 이클립스
- 생성자
- AWT
- 배열
- 클래스
- oracle
- 예외처리
- 안드로이드
Archives
- Today
- Total
note
구글맵 사용하여 위도 경도값 직접입력해서 보기 본문
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:stretchColumns="1,2" > <TableRow> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="2dip" android:paddingRight="4dip" android:text="위도 경도:" /> <EditText android:id="@+id/lat" android:layout_width="fill_parent" android:layout_height="wrap_content" android:cursorVisible="true" android:editable="true" android:singleLine="true" android:layout_weight="1" /> <EditText android:id="@+id/lon" android:layout_width="fill_parent" android:layout_height="wrap_content" android:cursorVisible="true" android:editable="true" android:singleLine="true" android:layout_weight="1" /> </TableRow> </TableLayout> <Button android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="지도 보기!" /> </LinearLayout>
package kr.android.intent2;
import android.app.Activity;
import android.os.Bundle;
import android.widget.EditText;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import android.widget.Button;
public class LaunchDemo extends Activity {
private EditText lat;
private EditText lon;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btn = (Button)findViewById(R.id.map);
lat = (EditText)findViewById(R.id.lat);
lon = (EditText)findViewById(R.id.lon);
btn.setOnClickListener(new View.OnClickListener(){
public void onClick(View view){
String _lat=lat.getText().toString();
String _lon=lon.getText().toString();
Uri uri = Uri.parse("geo:"+_lat+","+_lon);
startActivity(new Intent(Intent.ACTION_VIEW,uri));
}
});
}
}
'Android > 기본' 카테고리의 다른 글
| 전화걸기2 컨텍트 프로바이더contact (0) | 2012.01.17 |
|---|---|
| 안드로이드 전화걸기 (0) | 2012.01.17 |
| Intent 사용하여 화면 이동 (0) | 2012.01.17 |
| 구글맵에 마커 표시하기(위치 지정) (2) | 2012.01.17 |
| 구글맵 사용하기 (0) | 2012.01.17 |