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

  • Home
  • SEARCH
  • 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 7656001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:39:29+00:00 2026-05-31T12:39:29+00:00

I have a widget and an activity, when I start the activity, I have

  • 0

I have a widget and an activity, when I start the activity, I have to read text from the TextView of the widget and show it in the TextWidget of the activity.

My relevant code:

 String frase=""; 
 TextView text_frase = (TextView) findViewById(R.id.widget_textview_frase);
 if (text_frase != null){
    frase = (String) text_frase.getText();
 }
 Log.v(LOG_CLASS_NAME, "frase: "+frase);

debugging it – I have text_frase as null (I think I can’t reference to a view object from another view.) Anyway, how could I do this?

  • 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-31T12:39:31+00:00Added an answer on May 31, 2026 at 12:39 pm

    No, you can’t. I suggest one of this ways:

    1. Adding your text to a Bundle and fetching it in your activity.

    in your widget:

    Intent intent = new Intent(context, YourActivity.class);
    Bundle b= new Bundle();
    b.putString("Text", yourtext);
    intent.putExtras(b);
    PendingIntent pendingIntent = PendingIntent.getActivity(context, appWidgetId, intent, PendingIntent.FLAG_CANCEL_CURRENT);
    

    in your activity:

    Intent intent=getIntent();
    Bundle b= intent.getExtras();
    String text= b.getString("Text", "");
    
    1. Using SharedPreferences for saving your text and loading it in the activity.

    In your situation, I recommend method 1.

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

Sidebar

Related Questions

I have a widget that supposed to call an Activity of the main app
How to start an activity after the animation has ended. I have added android:oneshot=true
I have an app with a widget that loads an activity to perform an
i have this code package com.tct.soundTouch; import android.app.Activity; import android.media.MediaPlayer; import android.os.Bundle; import android.view.MotionEvent;
i have executed the following code public class Activity_Threads_Handler extends Activity { private int
I have a button in my main activity (act1) and in a widget. That
I have an activity (BookMarks) that is called from main activity. BookMarks throw an
I have this code: package com.powergroupbd.timer; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.CountDownTimer;
I have a widget that acts as a launcher on the home screen. How
I have this widget: $this->setWidget('slug', new sfWidgetFormDoctrineChoice(array('model' => 'MyTable', 'method' => 'myMethod', 'key_method' =>

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.