我有个问题.我需要从一个活动转到另一个活动.我的第二个活动有一个很大的xml布局,有很多元素(我说的是大约四百个aprox.),然后需要几秒钟(太多)才能显示第二个Activity.
如何在两个活动之间显示"进度"对话框?
我正在尝试使用后台任务来执行此操作.
我的活动A中有这个方法:
private void goToYear() {
Intent intent = new Intent();
intent.setClass (getBaseContext(), YearActivity.class);
startActivity( intent);
}
Run Code Online (Sandbox Code Playgroud)
在我的活动B中:
public class YearActivity extends Activity {
private String TAG = "YearActivity ::";
private ProgressDialog pd = null;
@Override
public void onCreate( Bundle savedInstanceState) {
super.onCreate( savedInstanceState);
// Show the ProgressDialog on this thread
this.pd = ProgressDialog.show(this, "Working...", "Calculating the screen...", true, false);
// Start a new thread that will download all the data
new MakeYearTask().execute();
}
private void initCalendar () …Run Code Online (Sandbox Code Playgroud) 我试图在布局中设置像背景图像的图像(通过xml或代码)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_layout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/my_image">
Run Code Online (Sandbox Code Playgroud)
要么
View myLayout= findViewById( R.id.main_layout);
myLayout.setBackgroundResource(R.drawable.my_image);
Run Code Online (Sandbox Code Playgroud)
我的问题是android修复了所有背景屏幕中的图像,调整大小和修改图像比例.
如何设置图像,图像只占用必要的空间?(没有调整图像大小)
如何从ProfilePictureView转换为Bitmap?这是可能的?
我有一个带有项目列表的AutoCompleteTextView,我需要选择其中一个...
我做的事情如下:
myAutoCompleteTextView.setListSelection( index);
Run Code Online (Sandbox Code Playgroud)
和...
myAutoCompleteTextView.setText( index);
Run Code Online (Sandbox Code Playgroud)
但是不行......我怎么能默认设置一个项目?
android ×4