android - Move to another Activity from a tab view -
i created tab view 3 pages in 1 of pages added list view in view added text view should move activity when clicked when create intent n error , id of onclick never used error java.lang.illegalstateexception: not find method (view)
this code:
package com.halbader.runescape; import android.content.intent; import android.os.bundle; import android.support.v4.app.fragment; import android.support.v7.app.appcompatactivity; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; package com.halbader.runescape; import android.content.intent; import android.os.bundle; import android.support.v4.app.fragment; import android.support.v7.app.appcompatactivity; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; public class questspage extends fragment { public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.questspage, container, false); return rootview; } public void drslayerq(view view){ intent qintent = new intent(this, dragonslayerquest.class); questspage.this.startactivity(qintent); } }
try :
first bind proper id in java xml element. set onclicklistener , in that, call function (no need pass parameter).
public void drslayerq(view view){ intent qintent = new intent(getcontext(), dragonslayerquest.class); getactivity().startactivity(qintent); }
Comments
Post a Comment