You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by akilawickey <gi...@git.apache.org> on 2016/07/13 06:10:30 UTC
[GitHub] cordova-android pull request #316: CB-11078 Empty string for BackgroundColor...
GitHub user akilawickey opened a pull request:
https://github.com/apache/cordova-android/pull/316
CB-11078 Empty string for BackgroundColor preference crashes application
Fixed the bug
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/akilawickey/cordova-android master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-android/pull/316.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #316
----
commit f4a1956f0e66e61032a9179b4894a652e9717e96
Author: akilawickey <as...@gmail.com>
Date: 2016-07-12T22:16:57Z
fixed CB-11078 Empty string for BackgroundColor preference crashes application
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-android pull request #316: CB-11078 Empty string for BackgroundColor...
Posted by jcesarsh <gi...@git.apache.org>.
Github user jcesarsh commented on a diff in the pull request:
https://github.com/apache/cordova-android/pull/316#discussion_r70723738
--- Diff: test/res/xml/config.xml ---
@@ -35,6 +35,7 @@
<preference name="useBrowserHistory" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="showTitle" value="true" />
+ <preference name="BackgroundColor" value="true" />
--- End diff --
If you want to fix "empty string" crash shouldn't you do the test with an empty string?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-android pull request #316: CB-11078 Empty string for BackgroundColor...
Posted by akilawickey <gi...@git.apache.org>.
Github user akilawickey commented on a diff in the pull request:
https://github.com/apache/cordova-android/pull/316#discussion_r70745630
--- Diff: test/res/xml/config.xml ---
@@ -35,6 +35,7 @@
<preference name="useBrowserHistory" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="showTitle" value="true" />
+ <preference name="BackgroundColor" value="true" />
--- End diff --
Ok i fixed it... Thank you
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-android pull request #316: CB-11078 Empty string for BackgroundColor...
Posted by jcesarmobile <gi...@git.apache.org>.
Github user jcesarmobile commented on a diff in the pull request:
https://github.com/apache/cordova-android/pull/316#discussion_r72573856
--- Diff: framework/src/org/apache/cordova/CordovaActivity.java ---
@@ -175,9 +175,13 @@ protected void createViews() {
setContentView(appView.getView());
if (preferences.contains("BackgroundColor")) {
- int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
- // Background of activity:
- appView.getView().setBackgroundColor(backgroundColor);
+ try {
+ int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
+ // Background of activity:
+ appView.getView().setBackgroundColor(backgroundColor);
+ }catch (NumberFormatException e){
+ System.out.println(e.getMessage());
--- End diff --
Can you use e.printStackTrace(); instead of System.out?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-android pull request #316: CB-11078 Empty string for BackgroundColor...
Posted by jcesarmobile <gi...@git.apache.org>.
Github user jcesarmobile commented on a diff in the pull request:
https://github.com/apache/cordova-android/pull/316#discussion_r72573788
--- Diff: framework/src/org/apache/cordova/CordovaActivity.java ---
@@ -175,9 +175,13 @@ protected void createViews() {
setContentView(appView.getView());
if (preferences.contains("BackgroundColor")) {
- int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
- // Background of activity:
- appView.getView().setBackgroundColor(backgroundColor);
+ try {
+ int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
+ // Background of activity:
+ appView.getView().setBackgroundColor(backgroundColor);
+ }catch (NumberFormatException e){
--- End diff --
can you add a white space between } and catch?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-android pull request #316: CB-11078 Empty string for BackgroundColor...
Posted by akilawickey <gi...@git.apache.org>.
Github user akilawickey commented on a diff in the pull request:
https://github.com/apache/cordova-android/pull/316#discussion_r72578371
--- Diff: framework/src/org/apache/cordova/CordovaActivity.java ---
@@ -175,9 +175,13 @@ protected void createViews() {
setContentView(appView.getView());
if (preferences.contains("BackgroundColor")) {
- int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
- // Background of activity:
- appView.getView().setBackgroundColor(backgroundColor);
+ try {
+ int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
+ // Background of activity:
+ appView.getView().setBackgroundColor(backgroundColor);
+ }catch (NumberFormatException e){
+ System.out.println(e.getMessage());
--- End diff --
Ok i'll make the changes
On Thu, Jul 28, 2016 at 12:41 PM, jcesarmobile <no...@github.com>
wrote:
> In framework/src/org/apache/cordova/CordovaActivity.java
> <https://github.com/apache/cordova-android/pull/316#discussion_r72573856>:
>
> > @@ -175,9 +175,13 @@ protected void createViews() {
> > setContentView(appView.getView());
> >
> > if (preferences.contains("BackgroundColor")) {
> > - int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
> > - // Background of activity:
> > - appView.getView().setBackgroundColor(backgroundColor);
> > + try {
> > + int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
> > + // Background of activity:
> > + appView.getView().setBackgroundColor(backgroundColor);
> > + }catch (NumberFormatException e){
> > + System.out.println(e.getMessage());
>
> Can you use e.printStackTrace(); instead of System.out?
>
> \u2014
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/cordova-android/pull/316/files/1be6ae190cc5804ae73a12044d184e72bc026f9e#r72573856>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AKzUNOndsuxrQa3NLQc7zyXXlN1TZYWTks5qaFYugaJpZM4JLF9t>
> .
>
--
*Thanks and Regards,*Akila Wickramarachchi
Undergraduate at University Of Peradeniya
<https://www.linkedin.com/profile/view?id=AAMAABg_m_sBqt7aECwMPaTfYpf-olFytcSylC4&trk=hp-identity-headline>
Email : asak999@gmail.com
Linkedin : Akila Wickramarachchi
<https://www.linkedin.com/profile/view?id=AAMAABg_m_sBqt7aECwMPaTfYpf-olFytcSylC4&trk=hp-identity-name>
Blog : http://akilacollection.blogspot.com/
Github : https://github.com/akilawickey
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-android pull request #316: CB-11078 Empty string for BackgroundColor...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/cordova-android/pull/316
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-android issue #316: CB-11078 Empty string for BackgroundColor prefer...
Posted by codecov-io <gi...@git.apache.org>.
Github user codecov-io commented on the issue:
https://github.com/apache/cordova-android/pull/316
## [Current coverage][cc-pull] is **33.85%**
> Merging [#316][cc-pull] into [master][cc-base-branch] will not change coverage
```diff
@@ master #316 diff @@
==========================================
Files 11 11
Lines 960 960
Methods 197 197
Messages 0 0
Branches 156 156
==========================================
Hits 325 325
Misses 635 635
Partials 0 0
```
> Powered by [Codecov](https://codecov.io?src=pr). Last updated by [39165a8...f4a1956][cc-compare]
[cc-base-branch]: https://codecov.io/gh/apache/cordova-android/branch/master?src=pr
[cc-compare]: https://codecov.io/gh/apache/cordova-android/compare/39165a8694a35b58f0321fe283f90704e4af1dc1...f4a1956f0e66e61032a9179b4894a652e9717e96?src=pr
[cc-pull]: https://codecov.io/gh/apache/cordova-android/pull/316?src=pr
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-android pull request #316: CB-11078 Empty string for BackgroundColor...
Posted by akilawickey <gi...@git.apache.org>.
Github user akilawickey commented on a diff in the pull request:
https://github.com/apache/cordova-android/pull/316#discussion_r72580800
--- Diff: framework/src/org/apache/cordova/CordovaActivity.java ---
@@ -175,9 +175,13 @@ protected void createViews() {
setContentView(appView.getView());
if (preferences.contains("BackgroundColor")) {
- int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
- // Background of activity:
- appView.getView().setBackgroundColor(backgroundColor);
+ try {
+ int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
+ // Background of activity:
+ appView.getView().setBackgroundColor(backgroundColor);
+ }catch (NumberFormatException e){
+ System.out.println(e.getMessage());
--- End diff --
Changes has been done as you said.
All checks have passed.
Thank you
On Thu, Jul 28, 2016 at 1:23 PM, Akila Wicky <as...@gmail.com> wrote:
> Ok i'll make the changes
>
> On Thu, Jul 28, 2016 at 12:41 PM, jcesarmobile <no...@github.com>
> wrote:
>
>> In framework/src/org/apache/cordova/CordovaActivity.java
>> <https://github.com/apache/cordova-android/pull/316#discussion_r72573856>
>> :
>>
>> > @@ -175,9 +175,13 @@ protected void createViews() {
>> > setContentView(appView.getView());
>> >
>> > if (preferences.contains("BackgroundColor")) {
>> > - int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
>> > - // Background of activity:
>> > - appView.getView().setBackgroundColor(backgroundColor);
>> > + try {
>> > + int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
>> > + // Background of activity:
>> > + appView.getView().setBackgroundColor(backgroundColor);
>> > + }catch (NumberFormatException e){
>> > + System.out.println(e.getMessage());
>>
>> Can you use e.printStackTrace(); instead of System.out?
>>
>> \u2014
>> You are receiving this because you authored the thread.
>> Reply to this email directly, view it on GitHub
>> <https://github.com/apache/cordova-android/pull/316/files/1be6ae190cc5804ae73a12044d184e72bc026f9e#r72573856>,
>> or mute the thread
>> <https://github.com/notifications/unsubscribe-auth/AKzUNOndsuxrQa3NLQc7zyXXlN1TZYWTks5qaFYugaJpZM4JLF9t>
>> .
>>
>
>
>
> --
>
>
> *Thanks and Regards,*Akila Wickramarachchi
>
> Undergraduate at University Of Peradeniya
> <https://www.linkedin.com/profile/view?id=AAMAABg_m_sBqt7aECwMPaTfYpf-olFytcSylC4&trk=hp-identity-headline>
> Email : asak999@gmail.com
> Linkedin : Akila Wickramarachchi
> <https://www.linkedin.com/profile/view?id=AAMAABg_m_sBqt7aECwMPaTfYpf-olFytcSylC4&trk=hp-identity-name>
> Blog : http://akilacollection.blogspot.com/
> Github : https://github.com/akilawickey
>
--
*Thanks and Regards,*Akila Wickramarachchi
Undergraduate at University Of Peradeniya
<https://www.linkedin.com/profile/view?id=AAMAABg_m_sBqt7aECwMPaTfYpf-olFytcSylC4&trk=hp-identity-headline>
Email : asak999@gmail.com
Linkedin : Akila Wickramarachchi
<https://www.linkedin.com/profile/view?id=AAMAABg_m_sBqt7aECwMPaTfYpf-olFytcSylC4&trk=hp-identity-name>
Blog : http://akilacollection.blogspot.com/
Github : https://github.com/akilawickey
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-android pull request #316: CB-11078 Empty string for BackgroundColor...
Posted by akilawickey <gi...@git.apache.org>.
Github user akilawickey commented on a diff in the pull request:
https://github.com/apache/cordova-android/pull/316#discussion_r72578456
--- Diff: framework/src/org/apache/cordova/CordovaActivity.java ---
@@ -175,9 +175,13 @@ protected void createViews() {
setContentView(appView.getView());
if (preferences.contains("BackgroundColor")) {
- int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
- // Background of activity:
- appView.getView().setBackgroundColor(backgroundColor);
+ try {
+ int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
+ // Background of activity:
+ appView.getView().setBackgroundColor(backgroundColor);
+ }catch (NumberFormatException e){
+ System.out.println(e.getMessage());
--- End diff --
Ok i'll make the changes
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org