<uses-permission android:name="android.permission.INTERNET" />
package com.problemio;import java.io.InputStream;import java.util.ArrayList;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.NameValuePair;import org.apache.http.client.HttpClient;import org.apache.http.client.entity.UrlEncodedFormEntity;import org.apache.http.client.methods.HttpPost;import org.apache.http.impl.client.DefaultHttpClient;import org.apache.http.message.BasicNameValuePair;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.Button;import android.widget.EditText;public class LoginActivity extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login); // Show form for login_email final EditText loginEmail = (EditText) findViewById(R.id.login_email); String name = loginEmail.getText().toString(); // Show field for password final EditText password = (EditText) findViewById(R.id.password); String text = password.getText().toString(); // Show button for submit Button submit = (Button)findViewById(R.id.submit); // Show options for create-profile and forgot-password submit.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { String email = loginEmail.getText().toString(); String pass = password.getText().toString(); sendFeedback(pass, email); } }); }
android-android.os.networkOnMainThreadException
喵喵时光机
相关分类