package cn.sevensencond.petmonitor;

import cn.sevensencond.petmonitor.MapActivity;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		petserver server = new petserver();
		server.check_login(new serverHandle(){
			@Override
			public void onSuccess(petserver server)
			{
				petserver.userinfo ui = server.ui;
				Log.v("a", ui.userMail);
				setContentView(R.layout.welcome);
				
				server.getuserinfo(new serverHandle(){
					@Override
					public void onSuccess(petserver server)
					{
						Log.v("server","getuserinfo ok");
					}
					@Override
					public void onFailed(petserver server)
					{
						
					}
				});
				
			}
			@Override
			public void onFailed(petserver server)
			{
				
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	public void sendMessage(View view) {
        Intent intent = new Intent(this, MapActivity.class);
        startActivity(intent);
    }
}

@@ -453,29 +453,23 @@
 out.
-activity_main
+welcome
 );%0A%09%09%0A%09%09
 pets
@@ -464,16 +464,22 @@
 );%0A%09%09%0A%09%09
+final 
 petserve
@@ -585,32 +585,29 @@
 Success(
-petserver server
+String result
 )%0A%09%09%09%7B%0A%09
@@ -697,31 +697,37 @@
 ew(R.layout.
-welcome
+activity_main
 );%0A%09%09%09%09%0A%09%09%09%09
@@ -807,32 +807,29 @@
 Success(
-petserver server
+String result
 )%0A%09%09%09%09%09%7B
@@ -917,32 +917,29 @@
 nFailed(
-petserver server
+String result
 )%0A%09%09%09%09%09%7B
@@ -1008,32 +1008,29 @@
 nFailed(
-petserver server
+String result
 )%0A%09%09%09%7B%0A%09

update serverHandle