자바파일이 map과 receive 두개가 있습니다.

 

xml파일도 main과 input이렇게 두개 있구요

 

첫화면을 input으로 하고 첫화면에 버튼을 누르면 main이 뜨게하려는데

 

일단 첫화면을 뜨게 하려고 receive 자바 파일에서 셋컨텐트뷰 R.layout.main에서 main을 input으로 바꿔주었씁니다.

 

그런데 쏘리 창이 뜨는데  자바파일에서 순서가 있나요

프로젝트 만들때 생긴 기본자바는 map 자바 파일이고 새로 추가한 파일은 receive입니다.

 

이것이 map 자바파일이구요

 

 package com.andro.mapviewproj;

import android.os.Bundle;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;


public class MapViewActivity extends MapActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
       
        MapView mapView=(MapView) findViewById(R.id.mapview);
       
        mapView.setBuiltInZoomControls(true);
       
        GeoPoint geopt= new GeoPoint(
          (int)(37.208995*1E6), (int)(126.976396*1E6));
       
        MapController mapCtrl = mapView.getController();
        mapCtrl.setZoom(16);
        mapCtrl.setCenter(geopt);
    }
   
    protected boolean isRouteDisplayed(){
     return false;
    }
}

 


이것이 receive파일입니다.

 package com.andro.mapviewproj;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;


public class ReceiveActivity extends Activity implements OnClickListener{
 
 public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.input);
  
  Button btn=(Button)findViewById(R.id.button_send);
  btn.setOnClickListener(this);
 }
 
 public void onClick(View v){
  Intent it = new Intent(this, MapViewActivity.class);
  
  startActivity(it);
  finish();
 }
}

 

 

메인은 이거구요

 <?xml version="1.0" encoding="utf-8"?>

<com.google.android.maps.MapView
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:id="@+id/mapview"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:clickable="true"
 android:apiKey="0HsfFNEeEsDrTE7b24iE2YnlZX8da-67qjAbCyw"
 />
 



input은 이겁니다.

 <?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"
    >

   
<LinearLayout
 android:orientation="horizontal"
 android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 android:weightSum="1">
<TextView
 android:layout_width="60sp"
 android:layout_height="fill_parent"
 android:text="@string/name"
 android:layout_weight="0.10"/>
 </LinearLayout>
<EditText android:layout_height="wrap_content" android:id="@+id/edit_name" android:layout_width="fill_parent">
    <requestFocus></requestFocus>
</EditText>

<LinearLayout
 android:orientation="horizontal"
 android:gravity="right"
 android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 >
<Button android:id="@+id/button_send"
 android:layout_width="100sp"
 android:layout_height="wrap_content"
 android:text="OK"
/>
 </LinearLayout>
 </LinearLayout>


어떤게문제인지...