Quantcast
Channel: Android Mode - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 941

why same methods work Eclipse (+processingP3) and not in P3

$
0
0

the simplest example is::

Eclipse::

              @  Override
                    public void onAttach(Activity activity) {
                        super.onAttach(activity);
                        println("I am now in on attach life cycle");
                        act = super.getActivity();
                          c = act.getApplicationContext();
                          DisplayMetrics metrics = new DisplayMetrics();
                          act.getWindowManager().getDefaultDisplay().getMetrics(metrics);
                         println( metrics.widthPixels);
            }

returns== what is expected= myDisplay.width== some size

P3:error=== on attach() does not exists... and getWindowManager does not exist... and.... (....super has to be transformed in "getActivity()", but here it does not matter...)

Why???

so :: on create(), or on createdView() or on start()

exists:: Why??? not error.... returns nothing...

there is obviously something i have not understood: is the aim (P3, android mode) to make simpler things that are not so simple (though!!) with android or make these simple things impossible??? on attach() is not called??? what is the use for android imports if they are ignored???

thanks in advance because now i begin to be tired out by P3 android mode....


Viewing all articles
Browse latest Browse all 941

Trending Articles