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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:47:32+00:00 2026-06-10T15:47:32+00:00

I have to implement an application for my university and I need some advice

  • 0

I have to implement an application for my university and I need some advice from an expert 🙂 . I have an activity that use PageIndicator, every page is a fragment. Max one page is currently displayed. In every fragment there are 4 widget that contains a value read from application via Bluetooth (there is a serial device that send data via Bluetooth to the application) I think that my activity must have a independent thread that in a loop communicate with the serial devices. But when this thread reads value, how can send the data to the current fragment, in particular to the specified widget? the current widget must show most recent data read. In other words i need to know how a thread of activity can send a dato to the current fragment .
sorry for my english

  • 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-10T15:47:33+00:00Added an answer on June 10, 2026 at 3:47 pm

    while creating the fragments, record them in an ArrayList and create a custom fragment class that extends Fragment

    static public ArrayList<CustomFragment> fragmentsList = new ArrayList<CustomFragment>();
    
    // create new fragment
    // Example:
    // CustomFragment myFragment = new FragmentOne();
    
    fragmentsList.add(newlyCreatedFragment);
    

    and inside the fragment create a method to receive the updates, for example

    your fragment class:

    public class CustomFragment extends Fragment {
    
        public void receiveUpdate(String update) {
          // Do something
        }
    }
    

    then instead of “extends Fragment” use “extends CustomFragment”

    then from other classes

    CustomFragment theFragment = SomeClass.fragmentsList.get(0); // where 0 is the fragment's index
    theFragment.receiveUpdate("the update");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some advice for a design which I have to implement in application.
In my application i have Implement to take image from Gallery. In that gallery
I have Implement Some paint like application. For that the Layout is like as
I have to implement LDAP authentication with eDirectory in Java application. I guess some
I have to implement application that can post to the selected network I can
I have some string that have a type like this NSString *string1 = @/Users/mine/Library/Application
I need to open the my application from browser when some pattern matching url
I am going to implement an application that is gathering data from Android device.
I have to implement a functionality for a web application that provides an easy
I want to implement application settings to have them update settings that wont be

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.