I've two String Arrays like that ,
String[] htmlArray = {
"file:///android_asset/Pinocchio/OPS/chapter-001.xml",
"file:///android_asset/Pinocchio/OPS/chapter-002.xml",
"file:///android_asset/Pinocchio/OPS/chapter-035.xml",
"file:///android_asset/Pinocchio/OPS/chapter-035.xml"
};
String[] htmlArray1 = {
"file:///android_asset/Harry_Potter/OEBPS/part1.xhtml",
"file:///android_asset/Harry_Potter/OEBPS/part2_split_000.xhtml",
"file:///android_asset/Harry_Potter/OEBPS/part18_split_000.xhtml",
"file:///android_asset/Harry_Potter/OEBPS/part18_split_001.xhtml",
};
then, I put two ImageView in another class,
private void init() {
pino_cover = (ImageView) findViewById(R.id.pino_cover);
pino_cover.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent reader=new Intent(instance,ReaderScreen.class);
reader.putExtra("pino",true);
startActivity(reader);
}
});
harry_cover=(ImageView) findViewById(R.id.harry_cover);
harry_cover.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent reader=new Intent(instance,ReaderScreen.class);
reader.putExtra("harry",true);
startActivity(reader);
}
});
}
Then, if I click the Pino Image, I could get the data through htmlArray .
Intent i=getIntent();
Bundle b = i.getExtras();
String newText = b.
String setext=b.getString("harry");
if (newText=="pino")
pages = htmlArray;
else
pages = htmlArray1;
but if I click the Harry Image, it'd been taken to get the data through the htmlArray
too. I want to get htmlArray1
.
How could I get ?