[android-developers] How to initialize stuff that depends on the view’s attributes

2017-01-14 Thread rraallvv
Hello community,

I'm trying to get some parameters from the XML layout to be passed to some 
instance var like this:

public class MyView extends GLSurfaceView {
private MyRenderer mRenderer;

public MyView(Context ctx, AttributeSet attrs) {
super(ctx, attrs);
init(ctx);
}

private void init(Context ctx) {
mRenderer = new MyRenderer(ctx);
setRenderer(mRenderer);
}

@Override
public void setBackground(Drawable background) {
mRenderer.setBackground(background);
}}

To my knowledge setBackground is called before init, so mRenderer has not 
been initialized yet. It seems like a catch 22.

Is there some pattern I can use to get stuff initialized that depends on 
the view's parameters?

Best regards.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/c71780a5-9afe-423c-b3c0-01afff786624%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Can't run application

2017-01-14 Thread Marina Cuello
I run a quick Google search and found this issue:
https://code.google.com/p/android/issues/detail?id=201266.
Did you try the solutions marked there already?

Marina

On Sat, Jan 14, 2017 at 6:08 PM, Abrar Hossain 
wrote:

> Hi there,
>
> I am new to Android development and, whilst making a simple app, I ran
> across this error when I tried to run the app. Here are the configurations
> for my system:
>
> Intel Core i5 3rd gen
> 8GB of RAM
> OS: OpenSuse Tumbleweed
>
> Here is the error message being raised:
>
> Cannot launch AVD in emulator.
> Output:
> sh: lspci: command not found
> sh: glxinfo: command not found
> static QPlatformTheme* QKdeTheme::createKdeTheme(): Unable to determine
> KDE dirs
> libGL error: unable to load driver: i965_dri.so
> libGL error: driver pointer missing
> libGL error: failed to load driver: i965
> libGL error: unable to load driver: swrast_dri.so
> libGL error: failed to load driver: swrast
> X Error of failed request:  BadValue (integer parameter out of range for
> operation)
>   Major opcode of failed request:  155 (GLX)
>   Minor opcode of failed request:  24 (X_GLXCreateNewContext)
>   Value in failed request:  0x0
>   Serial number of failed request:  39
>   Current serial number in output stream:  40
> QObject::~QObject: Timers cannot be stopped from another thread
>
> Any suggestions will be greatly appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/android-developers/9b98e82b-779a-44bb-8115-
> 275019529125%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CACaNmX3z3T5yTg27m7TF_r8iv4L5-LdjNtmZMTbNqSfj51w-fg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Target device does not support the run as command

2017-01-14 Thread Marina Cuello
What you are pasting here is not "code", so it's not really helpful.
But I guess what you're saying is that to check the crash you need to see
the logcat, and then you see the "blah blah blah run-as" error message.
That error message can appear when there is something wrong with your
general setup. Try the old "close Android Studio and launch again", or
uncheck and then check again the "Enable ADB integration" option on Android
Studio, or go to command line and kill and restart adb.

Marina



On Sat, Jan 14, 2017 at 4:20 PM, Jon Prichard  wrote:

> hi,
>
> I am a complete beginner and have just started using android studio. when
> I try to run the following code on my Samsung S7 edge I get the message
> 'unfortunately, my first app has stopped' and android studio says 'target
> device does not support the 'run-as' command'. please can you help me fix
> this issue? the code is below, thanks.
>
> 
> https://schemas.android.com/apk/res/android*
> "
> xmlns:tools="*https://schemas.android.com/tools*
> "
> android:orientation="horizontal"
> android:layout_width="match_parent"
> android:layout_height="match_parent">
>  android:layout_weight="1"
> android:layout_width="0dp"
> android:layout_height="wrap_content"
> android:hint="@string/edit_message" />
>  android:layout_width="wrap_content"
> android:layout_height="wrap_content"
> android:text="@string/button_send" />
> 
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/android-developers/22313d66-f81b-4279-875c-
> 6b9a20202357%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CACaNmX2TMpEOO6zhpTzNbX6tX-kETT7%2Bh2nyMCyeg744_ZZ%3DoQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] generate signed apk error

2017-01-14 Thread Marina Cuello
You would probably find more help on Cordova specific list or forum, I
think we're here mostly Android SDK developers and perhaps won't be able to
help you.

Marina

On Sat, Jan 14, 2017 at 12:54 PM, Suthesan Rasamanikam 
wrote:

> can anyone help me? why i get this error?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/android-developers/44393b5e-6ccb-470a-86ed-
> 7359cdc00799%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CACaNmX2CHmXRz8kpoeKP%2BdCBsGXbg4vsSFni3-1miUkidXi46g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Using "findViewbyId' in Broadcast Receiver

2017-01-14 Thread abdullah zaman
How can I use findViewById() in a Broadcast Receiver class. Below is my 
code snippet. I get the error message: "can't resolve method findViewById" 
if used directly without class constructor (because find View by Id is 
Activity method and cant be used in Broadcast Receiver i suppose) . And if 
i try to use the class constructor (Where the imageView is available in my 
main activity) my app crashes saying " Unfortunately app has stopped" .

 I just want to change the color of ImageView e.g "from black to blue" in 
the below if statement if it is possible by any other means pleas let me 
know.

This is my Broadcast Receiver class

public class MyBroadcastReceiver extends FirstBroadcastReceiver {
Context context;Activity activity;public MyBroadcastReceiver(Context context, 
Activity activity){
this.context=context;
this.activity=activity;}

@Override
protected void (Context context) {
// content
}

@Override
public void onButton(Context context, boolean isClick) {

if(isClick) {

ImageView blueImage = (ImageView) activity.findViewById(R.id.imageView);
blueImage.setColorFilter(0xff00);
 }
}...
// and so on

And this is my Main Activity

public class MainActivity extends AppCompatActivity {
@Overrideprotected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
 // and so on
}}

MyBroadcastReceiver myBroadcastReceiver = new 
MyBroadcastReceiver(MainActivity.this,this);

 @Override
 public void onActivityResult() {
  // some code
  }
@Override
 public void onInitialized(MyManager manager){
 // some code   
 }


-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/31c0874e-3c84-4f1a-b17d-85cde28741ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Can't run application

2017-01-14 Thread Abrar Hossain
Hi there,

I am new to Android development and, whilst making a simple app, I ran 
across this error when I tried to run the app. Here are the configurations 
for my system:

Intel Core i5 3rd gen
8GB of RAM
OS: OpenSuse Tumbleweed

Here is the error message being raised:

Cannot launch AVD in emulator.
Output:
sh: lspci: command not found
sh: glxinfo: command not found
static QPlatformTheme* QKdeTheme::createKdeTheme(): Unable to determine KDE 
dirs
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for 
operation)
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  39
  Current serial number in output stream:  40
QObject::~QObject: Timers cannot be stopped from another thread

Any suggestions will be greatly appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/9b98e82b-779a-44bb-8115-275019529125%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Target device does not support the run as command

2017-01-14 Thread Jon Prichard
hi,

I am a complete beginner and have just started using android studio. when I 
try to run the following code on my Samsung S7 edge I get the message 
'unfortunately, my first app has stopped' and android studio says 'target 
device does not support the 'run-as' command'. please can you help me fix 
this issue? the code is below, thanks.


https://schemas.android.com/apk/res/android* 
"
xmlns:tools="*https://schemas.android.com/tools* 
"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">




-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/22313d66-f81b-4279-875c-6b9a20202357%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] system update

2017-01-14 Thread pakya raj
How can i update 4.4 kitkat to marshmallow or lollipop

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/863da369-1c22-4da0-a0e1-6e72e647c22f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Issue With License Test Response - Dev Console

2017-01-14 Thread Pete Nixon
Hi guys,

I'm having an issue testing licensing of my app which is currently in beta 
in the dev console. 

At the moment I am getting no responses from the app (no matter which test 
response I use). I have made sure my gmail account is in both the beta 
testers list and the license testing Testing Access box. I added the 
licensing using the example in the SDK, only changing what was necessary 
and the app builds fine. The only error I get is from the following bit of 
code (highlighted):

public void applicationError(int errorCode) {
if (isFinishing()) {
// Don't update UI if Activity is finishing.
return;
}
// This is a polite way of saying the developer made a mistake
// while setting up or calling the license checker library.
// Please examine the error code and fix the error.
String result = String.format(getString(R.string.application_error), 
errorCode);
displayResult(result);


More detail:
 


I'm new to programming so i don't know the relevance of this (if any).

Absolutely any and all advice would be much appreciated.

Thanks.


-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/4edf6746-4474-4e0f-b815-104832b8a693%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Gradle sync failed

2017-01-14 Thread April Potter
I downloaded Android 2.2 on my windows 7 which is a x86(32 bit) system and 
this is the error i keep getting

Please help

5:08:02 AM Gradle sync failed: CreateProcess error=216, This version of %1 
is not compatible with the version of Windows you're running. Check your 
computer's system information to see whether you need a x86 (32-bit) or x64 
(64-bit) version of the program, and then contact the software publisher
   Consult IDE log for more details (Help | Show Log)

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/ab248cbf-ae4a-4a2f-9347-2c61b0ac4c5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.