android - Cannot instate the type PagerAdapter? What's wrong? -


hey guys i'm trying swipe between activities using pageradapter i'm getting error here's code, i'm little new development of android, i'm unable understand problem i've found solution on internet. can tell me how fix it? appreciated, thanks! here's code:

pageradapter.java :-

package com.example.prototype;  import java.util.list;  import android.support.v4.app.fragment; import android.support.v4.app.fragmentmanager; import android.support.v4.app.fragmentpageradapter;  public class pageradapter extends fragmentpageradapter {      private list<fragment> fragments;      public pageradapter(fragmentmanager fm, list<fragment> fragments) {         super(fm);         this.fragments = fragments;      }      @override     public fragment getitem(int position) {         return this.fragments.get(position);     }      @override     public int getcount() {         return this.fragments.size();     } } 

viewpagerfragmentactivity :-

package com.example.prototype;  import java.util.list; import java.util.vector;  import android.os.bundle; import android.support.v4.app.fragment; import android.support.v4.app.fragmentactivity; import android.support.v4.view.pageradapter; import android.support.v4.view.viewpager;  import com.example.prototype.r; import com.example.prototype.games; import com.example.prototype.movies; import com.example.prototype.songs;  public class viewpagerfragmentactivity extends fragmentactivity {      private pageradapter mpageradapter;      @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         super.setcontentview(r.layout.viewpager_layout);          this.initialisepaging();     }      private void initialisepaging() {          list<fragment> fragments = new vector<fragment>();         fragments.add(fragment.instantiate(this, games.class.getname()));         fragments.add(fragment.instantiate(this, movies.class.getname()));         fragments.add(fragment.instantiate(this, songs.class.getname()));          this.mpageradapter  = new pageradapter(super.getsupportfragmentmanager(), fragments);      //error @ line!!!          viewpager pager = (viewpager) super.findviewbyid(r.id.viewpager);         pager.setadapter(this.mpageradapter);     } } 

whole logcat :-

04-25 14:08:12.082: e/vinput-seamless(108): found ps2 device 04-25 14:08:12.082: e/vinput-seamless(108): found seamless mouse device 04-25 14:08:17.726: e/setdpi(286): setting dpi 240 04-25 14:08:17.858: e/surfaceflinger(116): setorientation orientation=0 04-25 14:08:17.858: e/surfaceflinger(116): setorientation orientation=0 04-25 14:08:17.858: e/framebuffernativewindow(116): setorientation fbdev=0xb85a1af0 fbdev->setorientation=0xb6003f20 orientation=0 04-25 14:08:18.230: e/local_camera(112): have problem player connection 22 (invalid argument) 04-25 14:08:21.930: e/phonepolicy(117): not preload class phone policy: com.android.internal.policy.impl.phonewindow$contextmenucallback 04-25 14:08:23.410: e/genymotion(301): usbonlinepath not found 04-25 14:08:23.410: e/genymotion(301): batterystatuspath not found 04-25 14:08:23.410: e/genymotion(301): batteryhealthpath not found 04-25 14:08:23.410: e/genymotion(301): batterypresentpath not found 04-25 14:08:23.410: e/genymotion(301): batterycapacitypath , batteryenergypaths not found 04-25 14:08:23.410: e/genymotion(301): batteryvoltagepath not found 04-25 14:08:23.410: e/genymotion(301): batterytemperaturepath not found 04-25 14:08:23.410: e/genymotion(301): batterytechnologypath not found 04-25 14:08:25.174: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:08:25.182: e/libsuspend(301): error opening /sys/power/autosleep: no such file or directory 04-25 14:08:25.182: e/libsuspend(301): error opening /sys/power/wakeup_count: permission denied 04-25 14:08:25.182: e/libsuspend(301): failed initialize autosuspend 04-25 14:08:25.282: e/wvmextractor(119): failed open libwvm.so 04-25 14:08:25.318: e/wvmextractor(119): failed open libwvm.so 04-25 14:08:25.326: e/eventhub(301): not driver version /dev/input/mouse3, not typewriter 04-25 14:08:25.350: e/eventhub(301): not driver version /dev/input/mouse2, not typewriter 04-25 14:08:25.366: e/eventhub(301): not driver version /dev/input/mouse1, not typewriter 04-25 14:08:25.406: e/eventhub(301): not driver version /dev/input/mouse0, not typewriter 04-25 14:08:25.442: e/eventhub(301): not driver version /dev/input/mice, not typewriter 04-25 14:08:25.458: e/connectivityservice(301): ignoring protectednetwork 10 04-25 14:08:25.458: e/connectivityservice(301): ignoring protectednetwork 11 04-25 14:08:25.458: e/connectivityservice(301): ignoring protectednetwork 12 04-25 14:08:25.466: e/wifistatemachine(301): failed reload sta firmware java.lang.illegalstateexception: command '2 softap fwreload eth1 sta' failed '400 2 softap operation failed (success)' 04-25 14:08:25.570: e/wificonfigstore(301): error parsing configurationjava.io.filenotfoundexception: /data/misc/wifi/ipconfig.txt: open failed: enoent (no such file or directory) 04-25 14:08:25.574: e/wifistatemachine(301): failed set frequency band 0 04-25 14:08:26.402: e/gpslocationprovider(301): no agps interface in agps_data_conn_open 04-25 14:08:26.454: e/activitythread(423): failed find provider info com.android.inputmethod.latin.dictionarypack 04-25 14:08:26.458: e/binarydictionarygetter(423): not find dictionary pack 04-25 14:08:27.922: e/wvmextractor(119): failed open libwvm.so 04-25 14:08:28.074: e/wvmextractor(119): failed open libwvm.so 04-25 14:08:28.270: e/wvmextractor(119): failed open libwvm.so 04-25 14:08:28.314: e/wvmextractor(119): failed open libwvm.so 04-25 14:08:28.334: e/wvmextractor(119): failed open libwvm.so 04-25 14:08:30.174: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:08:51.417: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:08:56.417: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:09:01.418: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:09:06.417: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:09:11.417: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:09:16.418: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:09:21.417: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:09:26.418: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:09:31.421: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:09:36.421: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:09:41.421: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:09:46.429: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:09:51.430: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:09:56.433: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:10:01.433: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:10:06.434: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:10:11.434: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:10:16.433: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:10:21.433: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:10:26.437: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:10:31.437: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:10:36.437: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:10:41.437: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:10:46.438: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:10:51.437: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:10:56.437: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:11:01.441: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:11:06.441: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:11:11.441: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:11:16.441: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:11:21.441: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:11:26.441: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:11:31.442: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:11:36.445: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:11:41.445: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:11:46.445: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:11:51.445: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:11:56.446: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:12:01.445: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:12:06.445: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:12:11.445: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:12:16.445: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:12:21.445: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:12:26.449: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:12:31.449: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:12:36.449: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:12:41.449: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:12:46.449: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:12:51.450: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:12:56.449: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:13:01.449: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:13:06.453: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:13:11.453: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 04-25 14:13:16.453: e/genymotion(301): not open '/sys/class/power_supply/genymotion_fake_path/present' 

you have imported pageradapter framework instead of sublcass. in viewpagerfragmentactivity

change

import android.support.v4.view.pageradapter; 

to

import com.example.prototype.pageradapter; 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -