Я создал один линейный макет внутри вида прокрутки (Горизонтальный) в формате xml с номером кнопки.
У меня также есть одна таблица "TABLE_SUBJECT" в базе данных.
Мне нужно установить тему для кнопки избазы данных, но я не понимаю, как это сделать.Я много искал, но не нашел ничего полезного.
Пожалуйста, дайте мне подсказку или ссылку.
Вот мой код:
Main.xml
<HorizontalScrollView android:layout_width="fill_parent"
android:id="@+id/horizontalScrollView1"
android:background="@color/myMaroonColor"
android:layout_height="wrap_content">
<LinearLayout android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="62dp" >
<!-- android:background="@drawable/qaapti"-->
<Button android:textSize="15px" android:id="@+id/button9" android:gravity="center|bottom" android:textColor="@color/myWhiteColor" android:drawableTop="@drawable/math" android:text="@string/HomePage_Math" android:background="@color/myMaroonColor" android:layout_width="54dp" android:layout_height="wrap_content" android:clickable="true"></Button>
<Button android:textSize="15px" android:id="@+id/button11" android:gravity="center|bottom" android:layout_width="54dp" android:textColor="@color/myWhiteColor" android:drawableTop="@drawable/stat" android:text="@string/HomePage_Statstics" android:background="@color/myMaroonColor" android:layout_height="wrap_content"></Button>
<Button android:textSize="15px" android:id="@+id/button10" android:gravity="center|bottom" android:textColor="@color/myWhiteColor" android:drawableTop="@drawable/biology" android:text="@string/HomePage_Biology" android:background="@color/myMaroonColor" android:layout_width="55dp" android:layout_height="wrap_content"></Button>
<Button></Button>
-
-
-
-
<Button></Button>
<Button android:textSize="15px" android:id="@+id/button7" android:gravity="center|bottom" android:textColor="@color/myWhiteColor" android:drawableTop="@drawable/physics" android:text="@string/HomePage_Physics" android:background="@color/myMaroonColor" android:layout_width="50dp" android:layout_height="wrap_content"></Button>
<Button android:textSize="15px" android:id="@+id/button6" android:gravity="center|bottom" android:textColor="@color/myWhiteColor" android:text="@string/HomePage_Computer" android:background="@color/myMaroonColor" android:layout_width="58dp" android:layout_height="46dp" android:drawableTop="@drawable/computer"></Button>
</LinearLayout>
</HorizontalScrollView>
MySQLiteHelper.java
public List<ObjectiveWiseQuestion>getAllSubject()
{
List<ObjectiveWiseQuestion>LocwiseProfileList=new ArrayList<ObjectiveWiseQuestion>();
String selectQuery= "SELECT * FROM " + TABLE_SUBJECT;
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
// looping through all rows and adding to list
if (cursor.moveToFirst())
{
do {
ObjectiveWiseQuestion owq= new ObjectiveWiseQuestion();
owq.setSubjectName(cursor.getString(1));
LocwiseProfileList.add(owq);
}
while(cursor.moveToNext());
db.close();
}
return LocwiseProfileList;
}