• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Adding a new Class file and doesn't touch anything else more in android

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried a tutorial: Learn Java Like a Kid Build Fun Desktop and Mobile Apps And I have problems with Android Studio. Indeed what I have done is only create a class BubbleView: But I don't know what I have to do with the xml files... thanks

I've tried to modify some main_activity but it doesn't work!

 
Ranch Foreman
Posts: 313
4
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to have MainActivity class, which inflate with main_activity.xml.

Inside main_activity.xml, add the image view , where the tag is the image view class name, with package name.

 
Pedro Sosa
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I have a file named MainActivity.kt that appear to contain a class MainActivity. Is that the class MainActivity that you refer?


Besides, my activity_main.xml now it looks as


but it doesn't work

can you help me?
thanks
 
Randy Tong
Ranch Foreman
Posts: 313
4
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is Bubbledraw2? You have a class named Bubbledraw2?
 
Pedro Sosa
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No BubbleDraw2 is the name of the project!
can you help me?
 
Randy Tong
Ranch Foreman
Posts: 313
4
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pedro Sosa wrote:No BubbleDraw2 is the name of the project!
can you help me?


Replace to this
 
Pedro Sosa
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now th activity_main.xml looks:


But doesn't work
 
Ranch Hand
Posts: 83
2
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on line 10 you capitalized package name
 
Pedro Sosa
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again without work...and desperate!
 
Randy Tong
Ranch Foreman
Posts: 313
4
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you hint any errors?
 
Pedro Sosa
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


 
Adrian Grabowski
Ranch Hand
Posts: 83
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just tried it and it works for me (bubbles when I click on the screen) but I changed:



to

 
Pedro Sosa
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've changed to AppCompatImageView and nothing happened, can you send me your zip project, please?
 
Pedro Sosa
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
Adrian Grabowski
Ranch Hand
Posts: 83
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pedro Sosa wrote:I've changed to AppCompatImageView and nothing happened, can you send me your zip project, please?



I've uploaded it to github - have a look
 
Pedro Sosa
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!