• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

App Inventor How to make a text view equal to firebase string

Hello, I'm making a project using android studio and java. I have some data in a realtime firebase database and I'm trying to take the data in an activity then making a text view in another activity have the value of that data. I was able to get the data but I when I try to set the textview to equal to it, it does not change.. its like the value is null. I tried printing the value to know if it is null or not and it appeared okay so I dont know the problem.. heere is the code:
Java:
public class HistoryActivity extends AppCompatActivity {

    TextView history;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_history);
        history = (TextView) findViewById(R.id.historyText);

        showHistory();
    }

    void showHistory()
    {
        String history_text = getIntent().getStringExtra("HISTORY");
        System.out.println(history_text); //DEBUG
        history.setText(history_text);
    }
}

Here is the first class that takes the data and sends it:
Java:
protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        rootNode = FirebaseDatabase.getInstance();
        reference = rootNode.getReference("CompanyInfo");

        historyBtn = (Button) findViewById(R.id.historyBtn);
        addressBtn = (Button) findViewById(R.id.addressBtn);
        supportBtn = (Button) findViewById(R.id.supportBtn);
        visionBtn = (Button) findViewById(R.id.visionBtn);

        Query getTxt = reference;

        getTxt.addListenerForSingleValueEvent(new ValueEventListener() {
            @Override
            public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                if(dataSnapshot.exists())
                {
                    historyTxt = dataSnapshot.child("History").child("Text").getValue(String.class);
                }
            }

            @Override
            public void onCancelled(@NonNull DatabaseError databaseError) {
            }
        });


        historyBtn.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View v)
            {
                Intent intent = new Intent(getApplicationContext(), HistoryActivity.class);
                intent.putExtra("HISTORY", historyTxt);

                startActivity(intent);
            }
        });

I realllllly need help so anything is appreciated :)

Quick Memo pin

I'm glad it worked! If you haven't tried LastPass, it's very effective at generating impossibly complex passwords for each site and account; then storing them in your personal vault. You need only remember your master password to access the vault. It can also store PINS, notes, and other sensitive data... and it syncs across devices. I use it on my phone and PC. There's a "shared" folder which the Darling Bride and I share for common passwords.

As far as memorable PINs go, I can only suggest that you choose a PIN that only you would know: the last 4 digits of your parents' postal code, for example; or first 4 digits of another ID. Many people use their birth month & year: but that could be easily hacked. If you use that, use it in reverse order (year & month). Good luck!

BTW I'm a CHIEF, not a "CHEF"... as a Chief, I did so much, with so little, for so long, that I am now qualified to do anything with nothing. But you were close: I married a chef because I can pretty much burn water...

:D

Attachments

  • Chief_Shirt (2).jpg
    Chief_Shirt (2).jpg
    438.7 KB · Views: 301

Happy 2nd Birthday OnePlus 6

dDKIS2Tl.jpg


The OnePlus 6 is now 2 years old!

The 22nd May 2020 marks the 2nd birthday of the OnePlus 6 model which went on sale this day in 2018.


Whilst Open Beta releases have ceased, the stock, stable, OxygenOS releases will continue for the 6 & 6T with bi-monthly Android Security patch updates and hopefully an update to Android 11 sometime in Q2, (Apr-Jun), 2021.

board level issue?

do not know about the resister, but i would start with the ifixit website.

https://www.ifixit.com/Device/Samsung_Galaxy_Tab_E_9.6_Wi-Fi

they sell all the parts and equipment you will need that are in their guides.

I did try this ifixit guides. Problem is still ongoing. Can't find proper looking schematic where I could see all part numbers, that would be helpful I believe. As mentioned before, charging port has been changed, battery can be ruled out as well as I have brand new replacement battery for it. None of the batteries are charging. Battery was my initial thought as tablet has been off for few months, so I thought it has gone in 'deep sleep' and has to be jumpstarted, but no, not the case, main board itself has no water damage, no rust or corrosion can be seen on board components, but this resistor does look like it has like tiny crack on one side + if you try do readings from it, readings jump up and then flatten out to zero again.

Battery incompatibility issue

Yes I have to no avail. Some metal fragments had come loose so it needs to be replaced I'm sure. But thanks!



It really wouldn't be practical to buy all the tools I need to attempt this EVEN if I was inclined to try this, but thanks for your input.


Your welcome :)

If you're able to find a solution to the issues your having please post back with the info. It msy help someone else.

Welcome to Android Forums @G2gor :)

Android Studio 3.6.3 extremely slow in debug mode

Not only debugging on device is slow, but on the emulator also. Step takes 5-20 sec to execute.
I am using Ubuntu, so Windows recommendations are irrelevant.

In general, Android Studio is not getting better with new releases. Practically every version has regressions. It seems that their QA department is not functional.
Specifically with 3.6.3 in addition to slow debugging, there is a serious issue with caching. On every launch I see something like:
Changes were not applied.
Modifications to AndroidManifest.xml require an app restart.
Manifest 'AndroidManifest.xml' was modified.
Reinstall and restart app

Help COVID-19 tracking in Google play services

I look at this Apple-Google venture to be more of a boring, incidental yawn. The topic has been a flurry of discussion online for weeks now, and the code has been vetted and verified by several independent security analysts as valid and following the privacy and security statements that Apple and Google have published. But as @Hadron commented, it's just an API. Despite all the moral outrage the code itself isn't some kind of personal data mining violation it's not assessing anyone's status and retaining anything in a covert database, it's a contact tracing service.
The problem is what kind of apps will be implemented to use this API, and by whom. That's the diversion.

Help How to use multiple physical keyboard layouts on Android Oreo 8.1.0 Go Edition phones?

After connecting Bluetooth keyboard to my Android phone, I can't add more than one physical keyboard layout.
I mean, using the Ctrl + Space shortcut that has multiple physical keyboard layout options, I can't. My Android phone version is 8.1.0 Oreo Go Edition.

I can't even use the Android system keyboard shortcut!
Example: Notification is displayed by pressing search + n. But pressing the shortcut key is not working.

Attachments

  • Screenshot_20200518-214956.png
    Screenshot_20200518-214956.png
    75 KB · Views: 505
  • Screenshot_20200518-215141.png
    Screenshot_20200518-215141.png
    91 KB · Views: 431

Filter

Back
Top Bottom