2016-06-19 11 views
0

登録リンクを作成しましたが、機能しません。私はログインページから登録ページに私を送るために「ここに登録する」リンクが必要です。私の前の質問に答えが出てから前に働いていましたが、今は私のために働いていません。誰か助けてくれますか?Androidスタジオ登録リンク

Login.java:

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

etUsername = (EditText) findViewById(R.id.etUsername); 
etPassword = (EditText) findViewById(R.id.etPassword); 
tvRegisterLink = (TextView) findViewById(R.id.tvRegisterLink); 
bLogin = (Button) findViewById(R.id.bLogin); 

bLogin.setOnClickListener(this); 
tvRegisterLink.setOnClickListener(this); 

userLocalStore = new UserLocalStore(this); 
} 

のAndroidManifest.xml:

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:supportsRtl="true" 
    android:theme="@style/AppTheme" > 
    <activity android:name=".MainActivity" 
     android:label="Login register" 
     > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <activity 
     android:name=".Login" 
     android:label="Login" > 
    </activity> 
    <activity 
     android:name=".Register" 
     android:label="Register" > 
    </activity> 
</application> 

activity_login.xml:

<TextView 
    android:clickable="true" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Register Here" 
    android:id="@+id/tvRegisterLink" 
    android:layout_alignParentBottom="true" 
    android:layout_centerHorizontal="true" 
    android:onClick="onClick" /> 

答えて

0

あなたのボタンからandroid:onClick="onClick"を削除してからのonClickにアクセスする必要がありますあなたのOnClickListener。 2つの方法のいずれかを選択する必要があります。あなたは、この回答によくリストされているのを見ることができますButton on click listener

関連する問題