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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:31:26+00:00 2026-06-15T08:31:26+00:00

I have made an application where i use a SimpleCursoradapter. String[] from = new

  • 0

I have made an application where i use a SimpleCursoradapter.

    String[] from = new String[] {"title","notes","image"};
    int[] to = new int[] { R.id.esodaTextView, R.id.amountTextView, R.id.imageView1}; 
    esodaAdapter = new SimpleCursorAdapter (this, R.layout.recipe_list_item, null, from, to);

As you can see i show the three data at 2 TextViews (esodaTextView + amountTextView) and at one imageView.

The question is how can i set a custom font (that is saved at assets folder) to these 2 TextViews (esodaTextView + amountTextView) so i can show text with the custom font.

This is the xml file for the list item:

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

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="10dp"
android:background="#55eee9e9" >

<TextView 
android:id="@+id/esodaTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:textSize="20dp"
android:textColor="#000000"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical" />

<TextView
android:id="@+id/amountTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/esodaTextView"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:paddingBottom="5dp"
android:textSize="12dp" />

<ImageView
android:id="@+id/imageView1"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:layout_alignParentRight="true"
android:src="@drawable/ic_launcher" />

</RelativeLayout>

I know that i can programmatically set a custom font via the following code but how can i use it inside a Simplecursoradaptor?

 TextView txt1 = (TextView) findViewById(R.id.textView1);  
 Typeface font = Typeface.createFromAsset(getAssets(), "segoescb.ttf");  
 txt1.setTypeface(font);

Thank you for your help in advance.

  • 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-06-15T08:31:26+00:00Added an answer on June 15, 2026 at 8:31 am

    What you want to do is overwrite the SimpleCursorAdapter’s ViewBinding:

    SimpleCursorAdapter.ViewBinder binding=adapter.setViewBinder( new SimpleCursorAdapter.ViewBinder()
      {
        boolean SetViewValue(View view, Cursor cursor, int columnIndex)
        {
          TextView tv=(TextView)view.findViewById(R.id.iesodaTextView)
          //Do what you want here
          return true;
        }
      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application in which we use a hand-made build system.The reason for
I have made a mobile application that use Google static maps to get map
I have made the decision to use monotouch to develop an application that browses
I have made my application in ASP.NET MVC 3. The server I use only
I am new in iphone development, and I have made a simple application for
I have made a small swing application for my personal use. This app connects
I have made a chat application where the chat view is formed from many
I have made a simple application in which i have use some buttons and
I have made a winform application for use within the company I work for(
To improve console application I have made I though adding some new functions to

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.