Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6209653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:01:27+00:00 2026-05-24T06:01:27+00:00

I have built a stackview widget for home Screen but i dont know how

  • 0

I have built a stackview widget for home Screen but i dont know how to load images into it so the user will be able to flip through the images and see different ones.

Here is the code i am using now and this is where the images are suppose to be downloaded and set to the remote View

I dont how to go about doing this and setting it to the remote view to display in the widget.

Here is the code i am using.. i followed the tutorial here on the developers website

http://developer.android.com/resources/samples/StackWidget/index.html

public class StackWidgetService extends RemoteViewsService {

@Override
public RemoteViewsFactory onGetViewFactory(Intent intent) {

    return new StackRemoteViewsFactory(this.getApplicationContext(), intent);


}
private static final int mCount = 10;
private List<WidgetItem> mWidgetItems = new ArrayList<WidgetItem>();
private Context mContext;
private int mAppWidgetId;
class StackRemoteViewsFactory implements RemoteViewsService.RemoteViewsFactory{

    public StackRemoteViewsFactory(Context context, Intent intent){

        mContext = context;
        mAppWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);

    }

    @Override
    public int getCount() {

        return mCount;
    }

    @Override
    public long getItemId(int position) {

        return position;
    }

    @Override
    public RemoteViews getLoadingView() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public RemoteViews getViewAt(int position) {

        RemoteViews rv = new RemoteViews(mContext.getPackageName(), R.layout.widget_item);
        rv.setTextViewText(R.id.widget_item, mWidgetItems.get(position).text);

        Bundle extras = new Bundle();
        extras.putInt(stackWidgetProvider.EXTRA_ITEM, position);
        Intent fillnIntent = new Intent();
        fillnIntent.putExtras(extras);
        rv.setOnClickFillInIntent(R.id.widget_item, fillnIntent);

        //Do heavy lifting here, Downloading images from a network or website.

        return rv ;
    }

    @Override
    public int getViewTypeCount() {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public boolean hasStableIds() {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public void onCreate() {
        // TODO Auto-generated method stub

    }

    @Override
    public void onDataSetChanged() {
        // TODO Auto-generated method stub

    }

    @Override
    public void onDestroy() {
        // TODO Auto-generated method stub

    }


}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:01:28+00:00Added an answer on May 24, 2026 at 6:01 am

    Have you tried including the images in the drawable or assets folder, and then loading the images from there? Once you know how to do that, then retrieving images from the web or other network location will be an easier jump.

    As far as getting the image from the web, check out: http://asantoso.wordpress.com/2008/03/07/download-and-view-image-from-the-web/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built an RSS Feed widget but my problem is how do I
I have built a number of asp.net servercontrols into a class library, & I
I have built an R package but I do not want my users to
I have built a User Control library that has a reference to a WCF
I have built a query which contains UNION ALL, but the two parts of
I have built a color well using objective c and cocoa but I am
I have built a User Control composed, as usual, of a XAML part and
I have built an android app, but it does not seem stable. It is
I have built an application which sends SMS messages via Java, but I am
I have built an MSI that I would like to deploy, and update frequently.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.