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

How can I add properties to the button from different pages?

Hello guys,

How can I add properties to the button from different pages/class ?

I need to add a property from the otherpage.java page to the button on the mainactivity.java page.But not working. (additional screenshots available)

I shouldn't open the MainActivity page (dont use Intent)

1.Page:Otherpage.java
Java:
        holder.btnSepeteEkle.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                MainActivity main = new MainActivity();
                main.test();
}


2.Page: MainActivity.java
Java:
    public void test(){
       Button buton = findViewById(R.id.buttondeneme);
       buton.setText("BUTTON TEST");
    }

Error Detail:
Code:
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.myapplication9, PID: 5087
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference
        at android.content.ContextWrapper.getApplicationInfo(ContextWrapper.java:159)
        at android.view.ContextThemeWrapper.getTheme(ContextThemeWrapper.java:157)

Attachments

  • sss.jpg
    sss.jpg
    379.3 KB · Views: 216

Help File Manager+ just stopped connecting to the Computer

Any suggestions would be great,
Use the vastly superior MiXplorer Silver. :D

Compared to FM+...well, there's no comparison! File operations on my computers that take minutes with FM+ take milliseconds with MiX. There are many other reasons it's superior, but try it yourself if you're interested.

As for your connection problem, as @svim pointed out, it's not your router's address you need, it's your computer's. I've assigned static IP addresses to all of my computers, ranging from 192.168.1.100 on up. So, for example, if I'm connecting to my dining-room laptop, its address is 192.168.1.123. Supply the correct address, plus its login credentials, and it should work.

If you don't know the computer's IP address, there are various ways to find it. On Linux, the ifconfig command displays it.

Size problem - device same dpi, different resolutions

Hi everyone,

I'm blocked with this problem and maybe you can help me. I recently started to develop mobile application and I meet a problem with the size.

I have 2 devices: a redmi note 7 and a sony G3416.
I have defined my elements size and fonts size in each dimens.xml files (mdpi, hdpi, xhdpi...) to support each kind of dpi and the display is correct with almost all the devices.

In my case, the 2 devices use the xxhdpi one. But the problem is if I set the correct size for the 1st device, on the second, the size is too big. And if I reduce to fit the second, it become to small for the first one. The size is not scaling as it should be. For the information, I use the DP and SP unit correctly.

Do you have any idea ? Below some screenshots so you can see the problem. Thanks

upload_2020-5-20_16-22-32.png


upload_2020-5-20_16-20-46.png

The Sixth Hero joins Masketeers: Idle Has Fallen!

[EARLY ACCESS] MASKETEERS: IDLE HAS FALLEN

ban-home-masketeers.jpg
Masketeers: Idle Has Fallen is an IDLE RPG that'll surprise you with genre-bending gameplay. Centered around an Orb-system with Idle and RPG gameplay, Masketeers will surprise you with its unique gameplay!


Joining version 0.8.0 of Masketeers is Nightingale, a new masketeer who has the unique ability to overheal. With her newfound abilities, Nightingale vows to protect her friends and allies from danger!

"I'll be a voice, not an echo."​

IXjhM63.png
Nightingale's key skill, Crested Champion is a versatile damage/ heal spell that can simultaneously dish out damage while healing your team. When you charge up Crested Champion enough times, you'll be able to use her ultimate technique: Aegis of Dawn, which shields your allies for 50% of their health!

Masketeers: Idle Has Fallen has been in Early Access since March 2020, and has been building in popularity. Join now before the Early Access ends and receive special rewards for your participation!


Join our communities on: Facebook | Twitter | Instagram | Discord

[FREE][GAME] Guess Picts Location - Geography Quiz

Hi everyone,

I would like to share with you my mobile game for Android. It's a quiz game to test your geographic knowledge.
From a picture, you will have to guess the right location. Each location is different so I'm pretty sure you will discover lot of new locations around the world.
There are 16 quizzes available right now from 19 planned. It mean there is already 320 locations to discover.

An important functionality of my game is that, for each location, you can explore them in 360° or Street View mode once you finished a quiz.

Thanks you. Hope you will have fun :)

* You can get it on Google Play: https://play.google.com/store/apps/details?id=com.amandin.guesspictslocation

Here some screenshots :
[GALLERY=media, 433]Minitiature_youtube by sbstorm posted May 20, 2020 at 10:35 AM[/GALLERY][GALLERY=media, 434]1. En_Screenshot_home by sbstorm posted May 20, 2020 at 10:35 AM[/GALLERY][GALLERY=media, 435]2. En_Screenshot_mode_menu by sbstorm posted May 20, 2020 at 10:35 AM[/GALLERY][GALLERY=media, 436]4. En_Screenshot_start_screen by sbstorm posted May 20, 2020 at 10:35 AM[/GALLERY][GALLERY=media, 437]5. En_Screenshot_GIP by sbstorm posted May 20, 2020 at 10:35 AM[/GALLERY][GALLERY=media, 438]7. En_Screenshot_result by sbstorm posted May 20, 2020 at 10:35 AM[/GALLERY][GALLERY=media, 439]8. En_Screenshot_streetview by sbstorm posted May 20, 2020 at 10:35 AM[/GALLERY]

Filter

Back
Top Bottom