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 7586783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:30:42+00:00 2026-05-30T19:30:42+00:00

I have made a custom adapter class here is the code public class CustomArrayAdapterForReceipts

  • 0

I have made a custom adapter class

here is the code

public class CustomArrayAdapterForReceipts extends ArrayAdapter<Receipt> {
    private final Activity context;
    public final ArrayList<Receipt> receipt;

    public CustomArrayAdapterForReceipts(Activity context, ArrayList<Receipt> receipt) {
        super(context, R.layout.row_layout_receipts_listview, receipt);
        this.context = context;
        this.receipt = receipt;
    }

    static class ViewHolder {
        protected TextView referenceNo;
        protected TextView comments;
        protected ImageView receiptImage;
    }

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

            View view = null;
            LayoutInflater inflator = context.getLayoutInflater();
            view = inflator.inflate(R.layout.row_layout_receipts_listview, null);
            final ViewHolder viewHolder = new ViewHolder();

            viewHolder.referenceNo = (TextView) view.findViewById(R.id.rowReceiptTitle);
            viewHolder.comments = (TextView) view.findViewById(R.id.rowReceiptComments);
            viewHolder.receiptImage = (ImageView) view.findViewById(R.id.rowReceiptImage);

            Receipt file =  receipt.get(position);
            final byte[] blob = file.getImage();
            ByteArrayInputStream inputStream = new ByteArrayInputStream(blob);
            Bitmap imageBitmap = BitmapFactory.decodeStream(inputStream);
            imageBitmap = Bitmap.createScaledBitmap(imageBitmap, 30, 30, false);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            imageBitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
            viewHolder.receiptImage.setImageBitmap(imageBitmap);

            viewHolder.receiptImage.setOnClickListener(new View.OnClickListener() 
            {
             public void onClick(View v)
             {
                 Intent myIntent = new Intent(v.getContext(), TransferController.class);
                myIntent.putExtra("image", blob);
                startActivity(myIntent);
             }
        });

            viewHolder.referenceNo.setText(file.getReferenceNo());
            viewHolder.comments.setText(file.getComments());


            view.setTag(viewHolder);

        return view;
    }       
}

The problem exists at

myIntent.putExtra("image", blob);
startActivity(myIntent);

startActivity is not being recognized… Please tell me, i want to start a new activity here. What should i do…

BEST Regards

  • 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-30T19:30:43+00:00Added an answer on May 30, 2026 at 7:30 pm

    try like this you can get

    v.getContext().startActivity(myIntent);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom-made view that extends the View class. I would like 2
I have made a custom Attribute here named AAtribute, and for instance a class
i have a ListView for which i have made a custom adapter which extends
I have made my custom In extension method as shown below: public static class
Here's what I have: Custom-made C# CMS where the content is stored in a
I have made a custom class by inheriting a DateTimePicker and made some methods
So I have made a custom UIButton and added it to the code and
I have made a custom UINavigationController class so that I can have a UIAlertView
I have made a custom button bar as described here . Now, I want
Lets Suppose that I have made a custom authentication module that inherits IHttpModule class.

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.