Java コードから入力された動的テーブルに広告が入力されるアクティビティがあります。このテーブルには、ネットワークから非同期的に読み込まれる画像があります。広告を含めない場合、すべてが期待どおりに機能します。しかし、adview とネットワークから非同期に読み込まれる画像を含めると、画像がネットワークから読み込まれるまで UI がハングします。
動作を理解できませんでした。画像が adview と一緒に非同期に読み込まれるソリューションを教えてください。
以下は私の活動コードです:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/linearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="********"
ads:loadAdOnCreate="true"
/>
<ScrollView
android:id="@+id/scroll1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout
android:id="@+id/table_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow>
<TextView
android:id="@+id/left_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="left|center_vertical"
android:padding="5dip"
android:text="Code" />
<TextView
android:id="@+id/middle_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right|center_vertical"
android:padding="5dip"
android:text="Name of Company" />
<TextView
android:id="@+id/right_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="right|center_vertical"
android:padding="5dip"
android:text="1.3" />
</TableRow>
</TableLayout>
</ScrollView>
</LinearLayout>
ありがとう
アマンディープ