package com.example.android.booklisting;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v4.view.PagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class SliderAdapter extends PagerAdapter {
Context context;
LayoutInflater layoutInflater;
public SliderAdapter(Context context) {
this.context = context;
}
public String[] slide_headings = {
context.getString(R.string.onboard1Header),
context.getString(R.string.onboard2Header),
context.getString(R.string.onboard3Header)
};
}
我尝试过在上下文中传递,也尝试过 getResources().getString(),但仍然没有用。我究竟做错了什么?
皈依舞
慕田峪7331174
相关分类