assinging ring tone from a application in android

by ragu » Sat, 14 Mar 2009 02:11:12 GMT


Sponsored Links
 Hi all i am getting errors in the lines of code given below :

public class RecordController extends Activity implements
MusicUtils.Defs {
        final int STATE_START = 2;
    final int STATE_STOP = 1;
    final int STATE_IDLE = 0;
    public IMediaPlaybackService mService = null;


The error message is :


    IMediaPlaybackService cannot be resolved to a type
    IMediaPlaybackService cannot be resolved to a type
    IMediaPlaybackService cannot be resolved to a type
    IMediaPlaybackService cannot be resolved to a type
    MusicUtils cannot be resolved

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Imageadapter problems

Hi,
    Having a problem with an image adapter.  What I am trying to do is
get a list
of all the installed apps on my phone, display  their icons and name,
all in a grid
with 4 columns.

     On first look all seems well but I see duplicates in apparently
random locations
and when I scroll back to the beginning the content of the rows has
changed!  I cannot
ascertain any specific pattern.    Either whole rows have moved, or
the order of a
specific row has changed, or there are single duplicates on the
screen.

    Here is the XML and code:

layout_main.xml

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
        android:layout_width="wrap_content"
        android:gravity="center_vertical"
        android:layout_height="fill_parent">

        <GridView android:id="@+id/GridView"
android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:numColumns="4">
        </GridView>

</LinearLayout>


layout_row.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
        android:id="@+id/main_layout"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <ImageView  android:id="@+id/icon_image" android:layout_width="40dp"
                android:layout_marginLeft="20dp"
                android:paddingLeft="1px"
                android:gravity="right"
                android:layout_height="40dp">
        </ImageView>

        <TextView android:id="@+id/icon_text" android:layout_width="78dp"
                android:layout_marginBottom="5dp"
                android:layout_height="32dp" android:text="TextView"
android:gravity="center|top"
                android:textColorHighlight="#ffffff">
        </TextView>
</LinearLayout>


Code

@Override
public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mPackageManager = getPackageManager();

        setContentView(R.layout.layout_main);

        List<PackageInfo> installedPackages =
mPackageManager.getInstalledPackages(0);

        grid = (GridView) findViewById(R.id.GridView);
        grid.setAdapter(new ImageAdapter(mainActivity.this,
installedPackages, installedPackages.size()));
        }

public class ImageAdapter extends BaseAdapter {
        Context context;
        List<PackageInfo> list;
        int maxsize;

        public ImageAdapter(Context argContext, List<PackageInfo>
argPackageInfo, int argMaxsize) {
                context = argContext;
                list = argPackageInfo;
                maxsize = argMaxsize;
                }

        @Override
        public int getCount() {
                return maxsize;
        }

        @Override
        public View getView(final int position, View convertView, ViewGroup
parent) {
                View view;

                try {
                        if (convertView == null) {
                                LayoutInflater inflater = getLayoutInflater();
                                view = inflater.inflate(R.layout.layout_row, 
null);

                                TextView textview = (TextView) 
view.findViewById(R.id.icon_text);
                                textview.setTextSize(13f);
                                textview.setTextColor(0xffffffff);
        
textview.setText(mPackageManager.getApplicationLabel(list.get(position).applicationInfo));

                                ImageView imageview = (ImageView)
view.findViewById(R.id.icon_image);
                                
imageview.setScaleType(ImageView.ScaleType.FIT_CENTER);
        
imageview.setImageDrawable(mPackageManager.getApplicationIcon((list.get(position).applicationInfo)));

                        } else {

                                view = convertView;
                        }

                        return view;

                } catch (Exception e) {
                }

                return view = convertView;
        }

        @Override
        public Object getItem(int position) {
                                return position;
        }

        //@Override
        public long getItemId(int position) {
                return position;
        }
}


Any ideas or thoughts would be appreciated.

Kent

-- 

2. Android developers in Central Florida?

Anyone live within about 50 miles of Orlando? Is it every developer
for himself, or does anyone ever have a get together?

-- 

3. Android market and customers email...

4. Building Android Library Projects from the Command Line

5. BackupManager IGNORING BACKUP DATA without API key error message

6. Destroy Android Thread

7. Set Default Chooser when Selecting Image?