在Eclipse环境下一步一步教您做透明的背景。
File->New->Other->Android XML File->Next
选择Value,输入文件名,点击“Finish”来创建配置文件。
创建colors.xml

1
2
3
4
< ?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="transparent">#0000</color><!-- 0000是全透明,您也可以9000 -->
</resources>

创建styles.xml

1
2
3
4
5
6
7
8
< ?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="translucent">
    <item name="android:windowBackground">@color/transparent</item>  
    <item name="android:windowIsTranslucent">true</item>  
    <item name="android:windowAnimationStyle">@+android:style/Animation.Translucent</item>
    </style>
</resources>

Continue reading »

我们通过intent类的putExtra()方法传递数据
在调用之前

1
2
CharSequence text=t.getText();
ins.putExtra("MSG", text);  //将数据写入Intent类中

在另一个Activity中获取

1
2
3
4
5
6
Bundle extras=getIntent().getExtras();
if(extras!=null)
{
     EditText t=(EditText)findViewById(R.id.editText1);
     t.setText(extras.getCharSequence("MSG"));
}
© 2012 客家缘分小筑 Suffusion theme by Sayontan Sinha