这个程序的功能是实现登录界面+跳转到注册界面
<?xml version="1.0" encoding="utf-8"?>
package="com.example.dell.redrock">
<application
android:allowBackup="true"
android:label="redrock"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".WelcomeActivity" >
</activity>
</application>
MainActivity.java
public class MainActivity extends ActionBarActivity {
private EditText accountEdit;
private EditText passwordEdit;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
supportRequestWindowFeature(1);//隐藏标题栏
// setContentView(R.layout.activity_main);
View view= LayoutInflater.from(this).inflate(R.layout.activity_main,null);
setContentView(view);
TextView textView1 = (TextView) findViewById(R.id.text_register);
textView1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent =new Intent("com.example.dell.redrock.ACTION_START");
startActivity(intent);
}
});
//后面就是设置鼠标点击登录界面的一些逻辑,应该和跳转无关,所以就不贴了。免得太长。。。
RegisterActivity.java
package com.example.dell.redrock;
import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
/**
Resigter.java的代码好像贴出问题了。。。
不过我用显示调用都没有问题的,为什么隐式会出现问题呢。
直接stop
没有编译错误
Resigter.java的代码好像贴出问题了。。。
不过我用显示调用都没有问题的,为什么隐式会出现问题呢。
直接stop
没有编译错误
都没看到你哪个界面注册了com.example.dell.redrock.ACTION_START这个的intent-filter,肯定会报错啊 ,根本找不到页面,在manifest里面配置一下
可以把异常日志贴一下不