java - What do I have to change about my activity to integrate Swipe View? -
so current activity looks like:
package com.example; import com.google.analytics.tracking.android.easytracker; import com.google.android.gms.ads.adrequest; import com.google.android.gms.ads.adview; import android.app.activity; import android.os.bundle; public class testactivity extends activity{ @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.test_layout); // adview resource , load request. adview adview = (adview)this.findviewbyid(r.id.adview); adrequest adrequest = new adrequest.builder().build(); adview.loadad(adrequest); } @override protected void onstart() { super.onstart(); easytracker.getinstance(this).activitystart(this); // add method. } @override protected void onstop() { super.onstop(); easytracker.getinstance(this).activitystop(this); // add method. } }
my layout file looks this:
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/res-auto" android:layout_width="fill_parent" android:layout_height="fill_parent" > <com.google.android.gms.ads.adview android:id="@+id/adview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_weight="1" ads:adsize="smart_banner" ads:adunitid="ca-app-pub-1596992408570157/3380743224" /> <scrollview android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_above="@id/adview" android:layout_alignparenttop="true" > <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <textview android:id="@+id/textview1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="" android:textsize="24sp" android:textstyle="bold" /> <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="250dp" android:src="" /> <textview android:id="@+id/textview2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" /> <textview android:id="@+id/textview3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" /> <textview android:id="@+id/textview4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" /> <textview android:id="@+id/textview5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="currency: afghan afghani" /> <textview android:id="@+id/textview6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" /> <textview android:id="@+id/textview7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" /> </linearlayout> </scrollview> </relativelayout>
i add page consists of single webview. want user able swipe activity activity (the 1 webview). i'm having lot of problems figuring out how implement swipeviews. know have add/change current layout/activity file swipe view webview work? thank you!
you should use viewpager , activity must extend fragmentactivity. @ link.
Comments
Post a Comment