۱۳۹۵/۰۹/۰۵, ۰۶:۵۰ ب.ظ
برنامه پیش رو استخراج کننده فایل نصبی apk است. مشکلی که دارم این است که checkbox آیتم های لیست ویو درست کار نمی کنند.
با زدن دکمه بکاپ ازتمامی برنامه های نصب شده در گوشی یکجا بکاپ میگیرد و ارتباط بین checkbox و عملیات بکاپ برقرار نمی شود.
در لینک زیر یه بنده خدایی دیگه هم دقیقا مشکل منو داشته ولی راهنمایی درستی نشده:
https://codedump.io/share/e5iBvkoRD5x6/1...in-android
package com.backupandrestorepoint;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Typeface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Environment;
import android.text.Html;
import android.text.format.DateFormat;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ListView;
import android.widget.Toast;
public class AppMainActivity extends ListActivity {
private PackageManager packageManager = null;
private List<ApplicationInfo> applist = null;
private ApplicationAdapter listadaptor = null;
boolean blo = true;
Button btn1;
private ProgressDialog progressDialog;
ArrayList<CheckBox> cb;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_app);
btn1 = (Button)findViewById(R.id.button1);
Typeface localTypeface = Typeface.createFromAsset(getAssets(), "nexalight.otf");
btn1.setTypeface(localTypeface);
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new LoApplications().execute();
if(Utils.getFreeSpace() > 200L)
{
Toast.makeText(getApplicationContext(), "Hi", 100).show();
}
else
{
Toast.makeText(getApplicationContext(), "Enough Sapce", Toast.LENGTH_SHORT);
}
}
});
//
packageManager = getPackageManager();
final CheckBox chkbox = (CheckBox)findViewById(R.id.ccc);
chkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// TODO Auto-generated method stub
if(isChecked == true)
{
listadaptor = new ApplicationAdapter(AppMainActivity.this,R.layout.row, applist,true);
setListAdapter(listadaptor);
}
else
{
listadaptor = new ApplicationAdapter(AppMainActivity.this,R.layout.row, applist,false);
setListAdapter(listadaptor);
}
setListAdapter(listadaptor);
}
});
new LoadApplications().execute();
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
ApplicationInfo app = applist.get(position);
try {
Intent intent = packageManager
.getLaunchIntentForPackage(app.packageName);
if (null != intent) {
startActivity(intent);
}
} catch (ActivityNotFoundException e) {
Toast.makeText(AppMainActivity.this, e.getMessage(),
Toast.LENGTH_LONG).show();
} catch (Exception e) {
Toast.makeText(AppMainActivity.this, e.getMessage(),
Toast.LENGTH_LONG).show();
}
}
public void app()
{
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
@SuppressWarnings("rawtypes")
final List pkgAppsList = getPackageManager().queryIntentActivities( mainIntent, 0);
int z = 0;
for (Object object : pkgAppsList) {
ResolveInfo info = (ResolveInfo) object;
File f1 =new File( info.activityInfo.applicationInfo.publicSourceDir);
try{
String file_name = info.loadLabel(getApplicationContext().getPackageManager()).toString();
File f2 = new File(Environment.getExternalStorageDirectory() + File.separator + "FullBackup" + File.separator + "App");
f2.mkdirs();
f2 = new File(f2.getPath()+"/"+file_name+".apk");
f2.createNewFile();
InputStream in = new FileInputStream(f1);
OutputStream out = new FileOutputStream(f2);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0){
out.write(buf, 0, len);
}
in.close();
out.close();
System.out.println("فایل کپی شد.");
}
catch(FileNotFoundException ex){
System.out.println(ex.getMessage() + " in the specified directory.");
}
catch(IOException e){
System.out.println(e.getMessage());
}
}
}
private List<ApplicationInfo> checkForLaunchIntent(List<ApplicationInfo> list) {
ArrayList<ApplicationInfo> applist = new ArrayList<ApplicationInfo>();
for (ApplicationInfo info : list) {
try {
if (null != packageManager.getLaunchIntentForPackage(info.packageName)) {
applist.add(info);
}
} catch (Exception e) {
e.printStackTrace();
}
}
return applist;
}
private class LoadApplications extends AsyncTask<Void, Void, Void> {
private ProgressDialog progress = null;
@Override
protected Void doInBackground(Void... params) {
applist = checkForLaunchIntent(packageManager.getInstalledApplications(PackageManager.GET_META_DATA));
listadaptor = new ApplicationAdapter(AppMainActivity.this,R.layout.row, applist,false);
return null;
}
@Override
protected void onCancelled() {
super.onCancelled();
}
@Override
protected void onPostExecute(Void result) {
setListAdapter(listadaptor);
progress.dismiss();
super.onPostExecute(result);
}
@Override
protected void onPreExecute() {
progress = ProgressDialog.show(AppMainActivity.this, null,
"درحال لود کردن...");
super.onPreExecute();
}
@Override
protected void onProgressUpdate(Void... values) {
super.onProgressUpdate(values);
}
}
private class LoApplications extends AsyncTask<Void, Void, Void> {
private ProgressDialog progress1 = null;
@Override
protected Void doInBackground(Void... params) {
AppMainActivity.this.cb = new ArrayList<CheckBox>();
applist = checkForLaunchIntent(packageManager.getInstalledApplications(PackageManager.GET_META_DATA));
listadaptor = new ApplicationAdapter(AppMainActivity.this,R.layout.row, applist,true);
app();
return null;
}
@Override
protected void onPostExecute(Void result) {
setListAdapter(listadaptor);
progress1.dismiss();
super.onPostExecute(result);
}
@Override
protected void onPreExecute() {
listadaptor = new ApplicationAdapter(AppMainActivity.this,R.layout.row, applist,true);
progress1 = ProgressDialog.show(AppMainActivity.this, null,
"درحال تولید apk... ");
progress1.setCancelable(true);
super.onPreExecute();
}
@Override
protected void onProgressUpdate(Void... values) {
super.onProgressUpdate(values);
}
}
}
-----------------------------------------------------
package com.backupandrestorepoint;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.List;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
private List<ApplicationInfo> appsList = null;
private Context context;
private PackageManager packageManager;
private ArrayList<Boolean> checkList = new ArrayList<Boolean>();
public ApplicationAdapter(Context context, int textViewResourceId,
List<ApplicationInfo> appsList, boolean b) {
super(context, textViewResourceId, appsList);
this.context = context;
this.appsList = appsList;
packageManager = context.getPackageManager();
for (int i = 0; i < appsList.size(); i++) {
checkList.add(false);
}
}
@Override
public int getCount() {
return ((null != appsList) ? appsList.size() : 0);
}
@Override
public ApplicationInfo getItem(int position) {
return ((null != appsList) ? appsList.get(position) : null);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
if (null == view) {
LayoutInflater layoutInflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = layoutInflater.inflate(R.layout.row, null);
}
ApplicationInfo data = appsList.get(position);
if (null != data) {
TextView appName = (TextView) view.findViewById(R.id.app_name);
TextView packageName = (TextView) view.findViewById(R.id.app_paackage);
ImageView iconview = (ImageView) view.findViewById(R.id.app_icon);
CheckBox checkBox = (CheckBox) view.findViewById(R.id.cb_app);
checkBox.setTag(Integer.valueOf(position)); // set the tag so we can identify the correct row in the listener
checkBox.setChecked(checkList.get(position)); // set the status as we stored it
checkBox.setOnCheckedChangeListener(mListener); // set the listener
appName.setText(data.loadLabel(packageManager));
packageName.setText(data.packageName);
iconview.setImageDrawable(data.loadIcon(packageManager));
}
return view;
}
OnCheckedChangeListener mListener = new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
checkList.set((Integer)buttonView.getTag(),isChecked); // get the tag so we know the row and store the status
}
};
}
-----------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@drawable/button_selector"
android:text="@string/backup"
androidhadowColor="#ff000000"
androidhadowRadius="4.0"
androidhadowDy="2.0"
androidhadowDx="2.0"
android:textSize="20.0dip"
android:textColor="@androidolor/white" />
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@androidolor/black"
android:padding="2.0dip" >
<TextView
android:id="@id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5.0dip"
androidhadowColor="#ff000000"
androidhadowDx="3.0"
androidhadowDy="3.0"
android:drawableLeft="@drawable/app"
android:gravity="center"
androidhadowRadius="6.0"
android:text="Application Backup"
android:textColor="#ffffffff"
android:textSize="22.0dip" />
</RelativeLayout>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="369dp"
android:layout_above="@+id/button1"
android:layout_alignParentLeft="true"
android:layout_below="@+id/relativeLayout1"
>
</ListView>
<CheckBox
android:id="@+id/ccc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="18dp" />
</RelativeLayout>
----------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="@+id/app_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:padding="3dp"
androidcaleType="centerCrop" />
<RelativeLayout
android:id="@+id/RelativeLayout1"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingLeft="5dp" >
<TextView
android:id="@+id/app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:gravity="center_vertical"
android:textStyle="bold" />
<TextView
android:id="@+id/app_paackage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/app_name"
android:gravity="center_vertical" />
<!-- <CheckBox
android:id="@+id/cb_app"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
/> -->
</RelativeLayout>
</LinearLayout>
با زدن دکمه بکاپ ازتمامی برنامه های نصب شده در گوشی یکجا بکاپ میگیرد و ارتباط بین checkbox و عملیات بکاپ برقرار نمی شود.
در لینک زیر یه بنده خدایی دیگه هم دقیقا مشکل منو داشته ولی راهنمایی درستی نشده:
https://codedump.io/share/e5iBvkoRD5x6/1...in-android
package com.backupandrestorepoint;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Typeface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Environment;
import android.text.Html;
import android.text.format.DateFormat;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ListView;
import android.widget.Toast;
public class AppMainActivity extends ListActivity {
private PackageManager packageManager = null;
private List<ApplicationInfo> applist = null;
private ApplicationAdapter listadaptor = null;
boolean blo = true;
Button btn1;
private ProgressDialog progressDialog;
ArrayList<CheckBox> cb;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_app);
btn1 = (Button)findViewById(R.id.button1);
Typeface localTypeface = Typeface.createFromAsset(getAssets(), "nexalight.otf");
btn1.setTypeface(localTypeface);
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new LoApplications().execute();
if(Utils.getFreeSpace() > 200L)
{
Toast.makeText(getApplicationContext(), "Hi", 100).show();
}
else
{
Toast.makeText(getApplicationContext(), "Enough Sapce", Toast.LENGTH_SHORT);
}
}
});
//
packageManager = getPackageManager();
final CheckBox chkbox = (CheckBox)findViewById(R.id.ccc);
chkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// TODO Auto-generated method stub
if(isChecked == true)
{
listadaptor = new ApplicationAdapter(AppMainActivity.this,R.layout.row, applist,true);
setListAdapter(listadaptor);
}
else
{
listadaptor = new ApplicationAdapter(AppMainActivity.this,R.layout.row, applist,false);
setListAdapter(listadaptor);
}
setListAdapter(listadaptor);
}
});
new LoadApplications().execute();
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
ApplicationInfo app = applist.get(position);
try {
Intent intent = packageManager
.getLaunchIntentForPackage(app.packageName);
if (null != intent) {
startActivity(intent);
}
} catch (ActivityNotFoundException e) {
Toast.makeText(AppMainActivity.this, e.getMessage(),
Toast.LENGTH_LONG).show();
} catch (Exception e) {
Toast.makeText(AppMainActivity.this, e.getMessage(),
Toast.LENGTH_LONG).show();
}
}
public void app()
{
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
@SuppressWarnings("rawtypes")
final List pkgAppsList = getPackageManager().queryIntentActivities( mainIntent, 0);
int z = 0;
for (Object object : pkgAppsList) {
ResolveInfo info = (ResolveInfo) object;
File f1 =new File( info.activityInfo.applicationInfo.publicSourceDir);
try{
String file_name = info.loadLabel(getApplicationContext().getPackageManager()).toString();
File f2 = new File(Environment.getExternalStorageDirectory() + File.separator + "FullBackup" + File.separator + "App");
f2.mkdirs();
f2 = new File(f2.getPath()+"/"+file_name+".apk");
f2.createNewFile();
InputStream in = new FileInputStream(f1);
OutputStream out = new FileOutputStream(f2);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0){
out.write(buf, 0, len);
}
in.close();
out.close();
System.out.println("فایل کپی شد.");
}
catch(FileNotFoundException ex){
System.out.println(ex.getMessage() + " in the specified directory.");
}
catch(IOException e){
System.out.println(e.getMessage());
}
}
}
private List<ApplicationInfo> checkForLaunchIntent(List<ApplicationInfo> list) {
ArrayList<ApplicationInfo> applist = new ArrayList<ApplicationInfo>();
for (ApplicationInfo info : list) {
try {
if (null != packageManager.getLaunchIntentForPackage(info.packageName)) {
applist.add(info);
}
} catch (Exception e) {
e.printStackTrace();
}
}
return applist;
}
private class LoadApplications extends AsyncTask<Void, Void, Void> {
private ProgressDialog progress = null;
@Override
protected Void doInBackground(Void... params) {
applist = checkForLaunchIntent(packageManager.getInstalledApplications(PackageManager.GET_META_DATA));
listadaptor = new ApplicationAdapter(AppMainActivity.this,R.layout.row, applist,false);
return null;
}
@Override
protected void onCancelled() {
super.onCancelled();
}
@Override
protected void onPostExecute(Void result) {
setListAdapter(listadaptor);
progress.dismiss();
super.onPostExecute(result);
}
@Override
protected void onPreExecute() {
progress = ProgressDialog.show(AppMainActivity.this, null,
"درحال لود کردن...");
super.onPreExecute();
}
@Override
protected void onProgressUpdate(Void... values) {
super.onProgressUpdate(values);
}
}
private class LoApplications extends AsyncTask<Void, Void, Void> {
private ProgressDialog progress1 = null;
@Override
protected Void doInBackground(Void... params) {
AppMainActivity.this.cb = new ArrayList<CheckBox>();
applist = checkForLaunchIntent(packageManager.getInstalledApplications(PackageManager.GET_META_DATA));
listadaptor = new ApplicationAdapter(AppMainActivity.this,R.layout.row, applist,true);
app();
return null;
}
@Override
protected void onPostExecute(Void result) {
setListAdapter(listadaptor);
progress1.dismiss();
super.onPostExecute(result);
}
@Override
protected void onPreExecute() {
listadaptor = new ApplicationAdapter(AppMainActivity.this,R.layout.row, applist,true);
progress1 = ProgressDialog.show(AppMainActivity.this, null,
"درحال تولید apk... ");
progress1.setCancelable(true);
super.onPreExecute();
}
@Override
protected void onProgressUpdate(Void... values) {
super.onProgressUpdate(values);
}
}
}
-----------------------------------------------------
package com.backupandrestorepoint;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.List;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
private List<ApplicationInfo> appsList = null;
private Context context;
private PackageManager packageManager;
private ArrayList<Boolean> checkList = new ArrayList<Boolean>();
public ApplicationAdapter(Context context, int textViewResourceId,
List<ApplicationInfo> appsList, boolean b) {
super(context, textViewResourceId, appsList);
this.context = context;
this.appsList = appsList;
packageManager = context.getPackageManager();
for (int i = 0; i < appsList.size(); i++) {
checkList.add(false);
}
}
@Override
public int getCount() {
return ((null != appsList) ? appsList.size() : 0);
}
@Override
public ApplicationInfo getItem(int position) {
return ((null != appsList) ? appsList.get(position) : null);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
if (null == view) {
LayoutInflater layoutInflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = layoutInflater.inflate(R.layout.row, null);
}
ApplicationInfo data = appsList.get(position);
if (null != data) {
TextView appName = (TextView) view.findViewById(R.id.app_name);
TextView packageName = (TextView) view.findViewById(R.id.app_paackage);
ImageView iconview = (ImageView) view.findViewById(R.id.app_icon);
CheckBox checkBox = (CheckBox) view.findViewById(R.id.cb_app);
checkBox.setTag(Integer.valueOf(position)); // set the tag so we can identify the correct row in the listener
checkBox.setChecked(checkList.get(position)); // set the status as we stored it
checkBox.setOnCheckedChangeListener(mListener); // set the listener
appName.setText(data.loadLabel(packageManager));
packageName.setText(data.packageName);
iconview.setImageDrawable(data.loadIcon(packageManager));
}
return view;
}
OnCheckedChangeListener mListener = new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
checkList.set((Integer)buttonView.getTag(),isChecked); // get the tag so we know the row and store the status
}
};
}
-----------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@drawable/button_selector"
android:text="@string/backup"
androidhadowColor="#ff000000"
androidhadowRadius="4.0"
androidhadowDy="2.0"
androidhadowDx="2.0"
android:textSize="20.0dip"
android:textColor="@androidolor/white" />
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@androidolor/black"
android:padding="2.0dip" >
<TextView
android:id="@id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5.0dip"
androidhadowColor="#ff000000"
androidhadowDx="3.0"
androidhadowDy="3.0"
android:drawableLeft="@drawable/app"
android:gravity="center"
androidhadowRadius="6.0"
android:text="Application Backup"
android:textColor="#ffffffff"
android:textSize="22.0dip" />
</RelativeLayout>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="369dp"
android:layout_above="@+id/button1"
android:layout_alignParentLeft="true"
android:layout_below="@+id/relativeLayout1"
>
</ListView>
<CheckBox
android:id="@+id/ccc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="18dp" />
</RelativeLayout>
----------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="@+id/app_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:padding="3dp"
androidcaleType="centerCrop" />
<RelativeLayout
android:id="@+id/RelativeLayout1"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingLeft="5dp" >
<TextView
android:id="@+id/app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:gravity="center_vertical"
android:textStyle="bold" />
<TextView
android:id="@+id/app_paackage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/app_name"
android:gravity="center_vertical" />
<!-- <CheckBox
android:id="@+id/cb_app"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
/> -->
</RelativeLayout>
</LinearLayout>