// Path: app/src/main/java/com/topnews/android/gson/MyUser.java
// public class MyUser extends BmobUser implements Serializable{
// 
//     private String icon;        //我的头像
// 
//     private List<KeepInfo> keep;       //我的收藏
// 
//     public String getIcon() {
//         return icon;
//     }
// 
//     public void setIcon(String icon) {
//         this.icon = icon;
//     }
// 
//     public List<KeepInfo> getKeep() {
//         return keep;
//     }
// 
//     public void setKeep(List<KeepInfo> keep) {
//         this.keep = keep;
//     }
// }


import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.topnews.android.R;
import com.topnews.android.gson.MyUser;
import cn.bmob.v3.BmobUser;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.LogInListener;
package com.topnews.android.ui;




public class LoginActivity extends AppCompatActivity {

    private EditText mUserName,mPassword;
    private Button mLogin;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        mUserName= (EditText) findViewById(R.id.login_email_phone);
        mPassword= (EditText) findViewById(R.id.login_password);
        mLogin= (Button) findViewById(R.id.btn_login);

        mLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if (TextUtils.isEmpty(mUserName.getText()) || TextUtils.isEmpty(mPassword.getText())){

                    Toast.makeText(LoginActivity.this,"请输入登录账号或密码",Toast.LENGTH_SHORT).show();
                    return;
                }

                String loginAccount=mUserName.getText().toString().trim();
                String loginPassword=mPassword.getText().toString().trim();

// Path: app/src/main/java/com/topnews/android/gson/MyUser.java
// public class MyUser extends BmobUser implements Serializable{
// 
//     private String icon;        //我的头像
// 
//     private List<KeepInfo> keep;       //我的收藏
// 
//     public String getIcon() {
//         return icon;
//     }
// 
//     public void setIcon(String icon) {
//         this.icon = icon;
//     }
// 
//     public List<KeepInfo> getKeep() {
//         return keep;
//     }
// 
//     public void setKeep(List<KeepInfo> keep) {
//         this.keep = keep;
//     }
// }


// Path: app/src/main/java/com/topnews/android/ui/LoginActivity.java
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.topnews.android.R;
import com.topnews.android.gson.MyUser;
import cn.bmob.v3.BmobUser;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.LogInListener;

package com.topnews.android.ui;




public class LoginActivity extends AppCompatActivity {

    private EditText mUserName,mPassword;
    private Button mLogin;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        mUserName= (EditText) findViewById(R.id.login_email_phone);
        mPassword= (EditText) findViewById(R.id.login_password);
        mLogin= (Button) findViewById(R.id.btn_login);

        mLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if (TextUtils.isEmpty(mUserName.getText()) || TextUtils.isEmpty(mPassword.getText())){

                    Toast.makeText(LoginActivity.this,"请输入登录账号或密码",Toast.LENGTH_SHORT).show();
                    return;
                }

                String loginAccount=mUserName.getText().toString().trim();
                String loginPassword=mPassword.getText().toString().trim();

                BmobUser.loginByAccount(loginAccount, loginPassword, new LogInListener<MyUser>() {