我补充道
apply plugin: 'com.google.gms.google-services'
compile 'com.google.firebase:firebase-auth:10.0.1'
Run Code Online (Sandbox Code Playgroud)
在build.gridle(app)中
在我添加的模块中
classpath 'com.google.gms:google-services:3.0.0'
Run Code Online (Sandbox Code Playgroud)
这是我的代码
public class splashscr extends Activity implements View.OnClickListener{
TabHost tab ;
Button logbtn,signup;
EditText email,password,signupemail,signuppassword;
private FirebaseAuth firebaseAuth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tab =(TabHost) findViewById(R.id.tabhost);
logbtn = (Button) findViewById(R.id.btn_login);
signup = (Button) findViewById(R.id.btn_signup);
password = (EditText)findViewById(R.id.input_password);
email = (EditText)findViewById(R.id.input_email);
signupemail =(EditText)findViewById(R.id.signupinput_email);
signuppassword = (EditText) findViewById(R.id.signupinput_password);
firebaseAuth = FirebaseAuth.getInstance();
logbtn.setOnClickListener(this);
signup.setOnClickListener(this);
tab.setup();
TabHost.TabSpec spec = tab.newTabSpec("tag1");
spec.setIndicator("",getResources().getDrawable(R.drawable.loginpic));
spec.setContent(R.id.tab1);
tab.addTab(spec);
spec = tab.newTabSpec("tag2");
spec.setIndicator("",getResources().getDrawable(R.drawable.signupp));
spec.setContent(R.id.tab2); …Run Code Online (Sandbox Code Playgroud)