![]() | What is "(this)"? Page 63. |
|
08 Jun 2012, 16:01
Pieter Vlam (3 posts) |
The book states that a basic understanding of Java is sufficient but I don’t know where nor how to acquire that required knowledge. There are so many information sources. What is relevant for Android as far as “Java” is concerned? What is the “this” in: Thanks in advance! Pieter |
|
15 Jun 2012, 18:39
Rushil Vig (4 posts) |
Try checking out thenewboston’s youtube series on android. It helped me a lot to explain these small parts of java. |
|
25 Jun 2012, 18:48
Ed Burnette (1316 posts) |
“This” might help too: |
|
30 Jun 2012, 03:39
Dipesh Bhardwaj (1 post) |
Let’s consider a simple program to understand it: But in case, to achieve it we use “this”. Here i representing the internal working of this by a another simple program: This is the actual internal working of this, in every non static method of java this is implicitly imported. Now on Page 63: setContentView(new GraphicsView(this)); “(this)” is used to point the referrence to GraphicsView class of “onCreate” method, as in android display screen is taken up by an Activity, which hosts a View, which in turn host a canvas. |
|
24 Jul 2012, 01:45
Ed Burnette (1316 posts) |
Thanks for the tip. Note you can use the < pre > and < code > formatting tags in this forum to make code look prettier. |
| You must be logged in to comment |

