0

For some reason, when I try and launch a web page from an onClick event in my login screen nothing happens. This only occurs on tablets, and works fine when testing on the phone.

I get this error message on a Galaxy Tab when clicking the TextView.

01-30 10:59:43.137 126-386/? E/PHService﹕ SysfsAccess : opening's messed up, /sys/devices/platform/galcore/gpu/gpu0/gpufreq/scaling_governor Permission denied 01-30 10:59:43.137 126-386/? E/PHService﹕ GpuOperator : int android::GpuOperator::setScalingPolicy(android::sp<android::GpuUnitParam>&), check failed!!!!

The weird thing is I have the exact same syntax in another activity that opens the web page completely fine. Here are the two blocks of code. I changed the address to google for now.

This works in my MainActivity and fails in LoginActivity (only on tablets):

/* Open link to website  */
protected void openLink(View v){
    Uri url = Uri.parse("http://google.com");
    Intent launchBrowser = new Intent(Intent.ACTION_VIEW, url);
    startActivity(launchBrowser);
}

Here is the xml that does not work:

<TextView
        android:id="@+id/sign_up"
        android:layout_weight="1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:textColor="@color/white"
        android:onClick="openLink"
        android:text="sign up"
        android:textSize="25sp"
        android:layout_gravity="center"/>

There are two separate XML layouts for large/small screens which is the only difference I can think of. The definitions of the TextViews are exactly the same though.

Things I have tried:

  • Changing ids in both TextViews
  • Changing method names of both click handlers
  • Using ButterKnife to handle click events

Nothing has worked. Have tested on Nexus 7, GalaxyTab, and Nexus 4. It works completely fine on the Nexus 4.

pech0rin
  • 4,588
  • 3
  • 18
  • 22

1 Answers1

1

Have you tried looking into the screen sizes supported by your manifest? If you have separate layouts for large/small screens I'm wondering if this could be the issue. Check out this link http://developer.android.com/guide/topics/manifest/supports-screens-element.html. I would've made this a comment but I don't have enough rep.

TechnoloG
  • 56
  • 1
  • 7
  • I think this is on the right path. The error seems to suggest a rendering issue related to an incorrect DPI. – iheanyi Jan 30 '15 at 16:31
  • Unfortunately, specifying this does not help. I have tried a few different configurations with `` and none seem solve the issue. – pech0rin Jan 30 '15 at 16:45
  • Can you please update your question with that section of your manifest? – TechnoloG Jan 30 '15 at 16:47
  • I don't have that section in my manifest. Adding it in and removing it doesn't do anything. According to the documentation that is only relevant to let the app know whether or not the screen size is compatible with the app. Leaving it out of the manifest only means that it is scalable. `However, if your application does not work well when resized to fit different screen sizes, you can use the attributes of the ` – pech0rin Jan 30 '15 at 17:52
  • I think it's safe to say your application is not working well at the moment :) – TechnoloG Jan 30 '15 at 18:10
  • True. But this does not seem to be the issue as adding correct settings for supports-screens did not solve the problem. Also, the documentation does not mention event handling at all. The defaults for scaling the app based on the layouts seems to working correctly as per the documentation. Does not seem to be relevant. – pech0rin Jan 30 '15 at 19:39
  • Alright dude, I'm trying to help here so if you could post the manifest that would be helpful. This line `/sys/devices/platform/galcore/gpu/gpu0/gpufreq/scaling_governor Permission denied` specifically makes me think it's an issue with your manifest. – TechnoloG Jan 30 '15 at 19:45