David Go

Greenhorn
+ Follow
since Mar 30, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by David Go

Hey all I have looped to gather game icons which I put them into a variable that is inside an class:



In my mainActivity:



And I'm calling that back up once Glide populates that page by doing this:



But it seems to crash my app once it gets to the load(...) part. I know it has the app icon because I check it out using this:


and it came up just fine.

So what is it that I am missing in order to load these drawable variables into Glide?

LOG

2022-04-15 08:14:20.374 18885-18885/com.tutorialscache.tabslayout E/AndroidRuntime: FATAL EXCEPTION: main
       Process: com.tutorialscache.tabslayout, PID: 18885
       java.lang.NullPointerException: Argument must not be null
           at com.bumptech.glide.util.Preconditions.checkNotNull(Preconditions.java:29)
           at com.bumptech.glide.util.Preconditions.checkNotNull(Preconditions.java:23)
           at com.bumptech.glide.RequestBuilder.into(RequestBuilder.java:841)
           at com.example.telluridetainment.adapter.AndroidAdapter.onBindViewHolder(AndroidAdapter.java:62)
           at com.example.telluridetainment.adapter.AndroidAdapter.onBindViewHolder(AndroidAdapter.java:24)
           at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6781)
           at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6823)
           at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5752)
           at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6019)
           at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
           at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
           at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
           at androidx.recyclerview.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:557)
           at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
           at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
           at androidx.recyclerview.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:171)
           at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
           at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
           at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4194)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
           at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
           at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at androidx.viewpager.widget.ViewPager.onLayout(ViewPager.java:1775)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1915)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
           at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
           at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
           at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
           at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
           at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
           at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
           at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
           at com.android.internal.policy.DecorView.onLayout(DecorView.java:779)
           at android.view.View.layout(View.java:21912)
   2022-04-15 08:14:20.377 18885-18885/com.tutorialscache.tabslayout E/AndroidRuntime:     at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3080)
           at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2590)
           at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1721)
           at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7598)
           at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
           at android.view.Choreographer.doCallbacks(Choreographer.java:790)
           at android.view.Choreographer.doFrame(Choreographer.java:725)
           at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
           at android.os.Handler.handleCallback(Handler.java:883)
           at android.os.Handler.dispatchMessage(Handler.java:100)
           at android.os.Looper.loop(Looper.java:214)
           at android.app.ActivityThread.main(ActivityThread.java:7356)
           at java.lang.reflect.Method.invoke(Native Method)
           at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

2 months ago

Tim Moores wrote:Any messages in the logcat?

Is onViewCreated ever called?



Yes onViewCreated is being called. nothing relevant in the log files.
4 months ago
Hey all I am having a little bit of an issue with trying to call a fragment that has the videoview within it into my current fragment page.

When I click on the test button I set up it goes through the code without error but never shows the video fragment - I even gave it a background color of red so I could see it load into my current view.

My goal here is just to send a parameter of the video path to the video fragment videoview player and start playing it.

videoPlay.java



_fragvideoplayer.xml:



FragMovies.java:



_fragmovies.xml:



Main_activity.java:



activity_main.xml:



The path to the movie is correct. And the movie is there in the "external" SD card path. Clicking around on the new fragment (videoPlay) yields no video menu (play, remind, pause...) so its not there.

Any help would be great!
4 months ago
Hey all I can not seem to get this below code to work:

It keeps telling me:

Uncaught SyntaxError: missing ) after argument list

It looks like all my ")" are present and in the correct spots?

the HTML that I am getting the links from looks like this:

the XPath starts at the <span>. The XPath is this:

But like I said above I just get that JS error. I'm not even sure my XPATH logic is even correct since I'm not able to pass this error and continue on...

Help would be great!
Hey all I am trying my best to get this animation correct. Seems it may be in the Javascript but not sure.



The movie poster should load up in the center. Currently though its loading up all the way in the corner.



It should look like this when you click on a poster



Here is the codepen

Any help would be great!
Thanks all for the suggestions. This is what I came up with
2 years ago
Hey all the following code below works with highlighting the supplied word to search for but if there are more than just one (1) of that word in the sentence then it wont find it. It just stops at finding one (1) match.


The above code looks like this when ran and supplied the word "world" to find.



But now if I add to the sentence and add another "world" then hit the button this is what it looks like:



As you see, it still has the same highlighted word without also highlighting the second (2) "world".

UPDATE 1

I have attempted using regex in order to loop and find the needed word.


But this does not produce even one word found.
2 years ago
Hey all I am trying my best to convert this working CURL script to Java:



where:

   -k: Allow insecure server connections when using SSL
   -c <filename>: Write cookies to <filename> after operation
   -L: Follow redirects
   -b <data>: Send cookies from string/file
   -H <header/@file>: Pass custom header(s) to server
   -d <data>: HTTP POST data



I've searched around for java code that includes an example of creating a cookie but I have yet to find something that would help me with my code above.

The closest I could find and modify the POST call is this:



For postIT the value is:

However, it has an error of:


   error: null


Not sure why the error is null since postIT has data? So not only am I not able to run the modified code I did, I'm still wondering how I go about calling a GET command using the cookie even if the code above worked.

So, in a nutshell:


   - Fix httpPost error.
   - How to send cookie on other GET methods.


Help would be great!
2 years ago
Hey all I am looking to find a value using XPath and once found, replace that value with something else that I define.

Problem being is that my XML file has levels like:

I have not been able to find any examples that contain the above - mainly the ic:, jxdm:....

The code I scraped together is:

I would be open to using another framework if needed (and also makes this easier) but I'm trying to use what java already has included out of the box. And if there's something other than XPath that would also make this easier then please let me know.

If anyone can help then please do so
2 years ago
Hey all I am trying to place an animated GIF (as an icon image) in front of all other layers I have.

the code:

It all starts out with the showAniCard() then I call stopAniCard() then showBlinkingLight(). As you will see from the image below the gif if behind the card.

Currently this is what it looks like when it runs that code.



The grey square in the background is the animated GIF that's behind the card reader.

If I don't load the ReaderWithCard.png image then it shows but this does me no good since I need the card in it as well.



What am I missing from this that would make the animated GIF be on top of the card/reader?
2 years ago
Hey all I have the code below that changes the background of a cell to either RED or GREEN. It seems that when I comment out the GREEN else code that my excel sheet has all red for each cell box in row 1. Likewise, if I do the opposite and comment out RED and un-comment GREEN then all the cells in row 1 are green.

I'm not understanding what in the code below is making it color all the cells the same color even though the first 2 cells should be RED while all the others should be GREEN. I already checked my logic and its going to the first IF 2 times and then the rest is going to the else so that's correct.

My code:


I'm sure I am just looking over something quite obvious but at this time I'm not able to find what that may be.

Any help would be great!

Note: Also posted to the following forums:

codeguru
Stackoverflow
2 years ago

Dave Tolls wrote:The method setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment) in the type CellStyle is not applicable for the arguments (org.apache.poi.sl.usermodel.VerticalAlignment)

You've imported the wrong VerticalAlignment (I know, they are stupidly close in their package names).
You want the ss one, not the sl one.



It looks like "Middle" is not part of the SS?
2 years ago
Hey all I am trying to get my cell to vertical line instead of just being aligned by the left side using POI.

This is my java code:


However, the line headerCellStyle.setVerticalAlignment(VerticalAlignment.MIDDLE); has an error of:

The method setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment) in the type CellStyle is not applicable for the arguments (org.apache.poi.sl.usermodel.VerticalAlignment)

How can i go about getting this to work if I have already defined it as an static CellStyle headerCellStyle = workbook.createCellStyle();?
2 years ago
The // between Local Apps is said to take care of the space between the names. I was using something and it kept saying "cant find dir \Local"
2 years ago