Get real path from URI, Android KitKat new storage access framework [duplicate]

Get real path from URI, Android KitKat new storage access framework [duplicate]

This question already has an answer here: Android Gallery on Android 4.4 (KitKat) returns different URI for Intent.ACTION_GET_CONTENT 19 answers Before

Type List vs type ArrayList in Java

Type List vs type ArrayList in Java

(1) List<?> myList = new ArrayList<?>();(2) ArrayList<?> myList = new ArrayList<?>();I understand that with (1), implementations of the List interface can be swapped. It seems that (1) is typically used in an application regardless of need

When to use self over $this?

When to use self over $this?

In PHP 5, what is the difference between using self and $this?When is each appropriate? 1:Short Answer Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static

Sorting a vector of custom objects

Sorting a vector of custom objects

How does one go about sorting a vector containing custom (i.e. user defined) objects.Probably, standard STL algorithm sort along with a predicate (a function or a function object) which would operate on one of the fields (as a key for sorti

Reading Excel files from C#

Reading Excel files from C#

Is there a free or open source library to read Excel files (.xls) directly from a C# program? It does not need to be too fancy, just to select a worksheet and read the data as strings. So far, I've been using Export to Unicode text function

How to avoid having class data shared among instances?

How to avoid having class data shared among instances?

What I want is this behavior:class a: list = []x = a()y = a()x.list.append(1)y.list.append(2)x.list.append(3)y.list.append(4)print(x.list) # prints [1, 3]print(y.list) # prints [2, 4]Of course, what really happens when I print is:print(x

What is an IndexOutOfRangeException / ArgumentOutOfRangeException and how do I fix it?

What is an IndexOutOfRangeException / ArgumentOutOfRangeException and how do I fix it?

I have some code and when it executes, it throws a IndexOutOfRangeException, saying, Index was outside the bounds of the array.What does this mean, and what can I do about it?Depending on classes used it can also be ArgumentOutOfRangeExce

What does a “Cannot find symbol” compilation error mean?

What does a “Cannot find symbol” compilation error mean?

Please explain the following about the "Cannot find symbol" error:What does this error mean?What things can cause this error?How does the programmer go about fixing this error?This question is designed to be a comprehensive question about "

Providing white space in a Swing GUI

Providing white space in a Swing GUI

A GUI with no white space appears 'crowded'. How can I provide white space without resorting to explicitly setting the position or size of components?­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­

.NET: Best way to execute a lambda on UI thread after a delay?

.NET: Best way to execute a lambda on UI thread after a delay?

I had a situation come up that required running a lambda expression on the UI thread after a delay. I thought of several ways to do this and finally settled on this approachTask.Factory.StartNew(() => Thread.Sleep(1000)) .ContinueWith((t

Where is Button.DialogResult in WPF?

Where is Button.DialogResult in WPF?

In System.Windows.Forms.Button there is a property DialogResult, where is this property in the System.Windows.Controls.Button (WPF)? 1:There is no built-in Button.DialogResult, but you can create your own (if you like) using a simple att

Inconsistency in WPF command routing behavior depending on the UI focus state

Inconsistency in WPF command routing behavior depending on the UI focus state

I have a RoutedUICommand command which can be fired in two different ways:directly via ICommand.Execute upon a button click event;using declarative syntax: .The command is handled only by the top window: The first approach only works if

iText – HTML to PDF - Image is not displayed in PDF

iText – HTML to PDF - Image is not displayed in PDF

I have a html page with text, image and I am parsing the HTML content to iText to generate the PDF. In the generated PDF,Included images are not getting displayed and , only the text is getting displayed. If I pass the absolute path like D:

Understanding why “pimp my library” was defined that way in Scala

Understanding why “pimp my library” was defined that way in Scala

If I want to add a method to a class in Scala, I need to do something like:class RichFoo(f: Foo) { def newMethod = f.bar()}object RichFoo { implicit def foo2Rich(f: Foo) = new RichFoo(f)}Then f.newMethod will result in creation of RichFoo

How to run single Java file from a project in Eclipse?

How to run single Java file from a project in Eclipse?

I want to run one Java file from a project in Eclipse. There is code to insert into database in that Java file, I want to check from that single file whether its working or not. Is there any way to run a single Java file from a project?

Changing cell color using apache poi

Changing cell color using apache poi

I'm using Apache POI to read data in a spreadsheet of part numbers. I look up the part number in our database, if we have a CAD drawing of the part I color the part number cell green, if we don't I color it red. After the processing is do

C#: Any benefit of List.ForEach(…) over plain foreach loop?

C#: Any benefit of List.ForEach(…) over plain foreach loop?

I'm wondering why List.ForEach(Action) exists.Is there any benefit/difference in doing :elements.ForEach(delegate(Element element){ element.DoSomething(); });overforeach(Element element in elements) { element.DoSomething();}? 1:One key d

GDB: How to list all source files used for compilation

GDB: How to list all source files used for compilation

New to the project, have multiple source files used for compilation and some "could" be dynamic libraries, loaded at runtime. When debugging the executable using "GDB", is there a command to list all the source files (static) used to build

Iterate over enum?

Iterate over enum?

I'm trying to iterate over an enum, and call a method using each of its values as a parameter. There has to be a better way to do it than what I have now:foreach (string gameObjectType in Enum.GetNames(typeof(GameObjectType))){ GameObje

How to determine a 404 response status when using the HttpClient.GetAsync()

How to determine a 404 response status when using the HttpClient.GetAsync()

I am trying to determine the response returned by HttpClient's GetAsync method in the case of 404 errors using C# and .NET 4.5.At present I can only tell that an error has occurred rather than the error's status such as 404 or timeout.Curre

how do I iterate through internal properties in c#

how do I iterate through internal properties in c#

public class TestClass{ public string property1 { get; set; } public string property2 { get; set; } internal string property3 { get; set; } internal string property4 { get; set; } internal string property5

Control for displaying multiline text?

Control for displaying multiline text?

I need to display a multiline, read-only text - which control can be used for that? It should only dislay the text, like a Label does, however Label does not support multiline?Thanks for any hint :-) 1:You can display multi-line read-onl

How to check if collection contains items in given order using Hamcrest

How to check if collection contains items in given order using Hamcrest

How to check using Hamcrest if given collection is containing given items in given order? I tried hasItems but it simply ignores the order.List list = Arrays.asList("foo", "bar", "boo");assertThat(list, hasItems("foo", "boo"));//I want this

Prevent redrawing of controls on resize for Windows Forms

Prevent redrawing of controls on resize for Windows Forms

I have a TableLayoutPanel which holds a dynamic number of controls inside a SplitterPanel. A user may want to resize the panel to fit these Controls to avoid use of a scroll bar. This creates jitter on the container resize as well as the

How do i change the Android TimePicker minute intervals?

How do i change the Android TimePicker minute intervals?

I am writing an application where the user needs to specify a given point in time, but i can't seem to figure out how to set the minute values that the user can choose from, to only use increments of 5 instead of increments of 1.Simply put,