• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps every widgets includes background

linear = (ImageView)findViewById(R.id.image);

StringBuffer buf=new StringBuffer();
try{
// Other = createPackageContext("skin.test",Context.CONTEXT_IGNORE_SECURITY);
InputStream mIS1 = this.openFileInput("path.txt");
InputStreamReader tmp = new InputStreamReader(mIS1);
BufferedReader reader=new BufferedReader(tmp);

String str;


while ((str = reader.readLine()) != null) {
buf.append(str);
}

mIS1.close();

}catch (java.io.FileNotFoundException e) {
Log.i("FileNotFoundException","");
}
catch (Throwable t) {
Toast
.makeText(this, "Exception: "+t.toString(), 5000)
.show();
}
String rString = null;
if(buf.length() > 0)
rString = buf.toString();

BitmapFactory.Options bfo = new BitmapFactory.Options();
bfo.inSampleSize = 2;

Bitmap bm = BitmapFactory.decodeFile(rString, bfo);

//bitmap을 drawable로
BitmapDrawable d =new BitmapDrawable(bm);
linear.setBackgroundDrawable(d);

I wrote a path of image in sdcard in the 'path.txt'.

Like this, I set up background in the ImageView.

however, I don't know why, but!!

Every widget(like radiobutton, spinner, button) also get the same background.

This makes me crazy because I didn't set up for the widgets!!

I just set up the ImageView!!!!!!

WHy they continuously adds background for other widgets.

I just........ don't know and.... I just.......... Kinda.......

depressed................. OTL:(
 
Back
Top Bottom