I went to file -->app--> dependencies --> green plus sign and press on library dependency . Nothing show up. I trying to add the support v4 dependency so I can extend Fragment Activity . Now I having error cannot resolve symbol support.
import android.support.v4.app.FragmentActivity;
public class MainActivity extends FragmentActivity {
ViewPager viewpager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
viewpager = (ViewPager) findViewById(R.id.pager);
PagerAdapter padapter = new PagerAdapter(getSupportFragmentManager());
viewpager.setAdapter(padapter);
}
}
Open the build.gradle file for your application and add this line compile "com.android.support:support-v4:18.0.+"
Make sure you have downloaded the Android Support Repository using the SDK Manager.
ref here
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.