dimanche 24 juillet 2016

LoadURL in WebViewFragment from another class?

I have a class which extends WebViewFragment and what I want to achieve is to be able to load other URL from another class into this WebViewFragment class. Here is how my code looks like:

public class FragWeber extends WebViewFragment {

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

        WebView webView = getWebView();
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setBuiltInZoomControls(true);
        webView.getSettings().setDisplayZoomControls(false);

        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl("https://www.google.com");
    }
}

Any idea how to access the WebView to load other URL?

samedi 23 juillet 2016

How to change a value from an XML file using Java

I have an integers.xml located at res/values. What I want to achieve is to change a value (an int) to some other int, by using Java. This is my code and as you can see I am using the Random class to assign it to the xml Degree value. But it doesn't work...

btnStart.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Random objRandom = new Random();
            int intRandomNumber  = objRandom.nextInt(1440 - 1080 + 1) + 1080;
            int intXMLDegree = getResources().getInteger(R.integer.Degree);
            intXMLDegree = intRandomNumber;

            iv.startAnimation(rotation);


        }
    });

How to implement in app Billing to unlock app functions? Android Studio

I'm doing an app which has an activity with five buttons. I want to implement In-app Billing to "Unlock" 3 of those buttons. For Example: User1 has downloaded and installed my app on his cell phone, but he can only see 2 buttons of the original five buttons, but there is another button named "UNLOCK". If you click that button you will be able to pay $1 to Unlock the rest of the buttons and use their activities.

The problem is I don't know how to do that. I need help with this; hope you can help me.

How to filter on the onopen method from which html the websocket was opened?

on the onopen method can I know from wich .html the request came from ? so I can make an if out of that and do my stuff? I have index.html and chat.html I need to do different things on different loads

@ServerEndpoint("/proyecto")enter code here public class controlador { static ArrayList Usuarios = new ArrayList(); private static final Set sessions = Collections.synchronizedSet(new HashSet());

@OnOpen
public void onOpen(Session s) {
    System.out.println(s.getId() + " abrió conexión");
    sessions.add(s);
    loopUsuariosId(s);
    broadcastMsg("nuevousu", s);         
}

Can findViewById(android.R.id.content) ever return null for Snackbars?

I want to be able to display Snackbars but I am confused by this notion that I have to supply it with a View. You'd think it'd allow you to display the Snackbar at the bottom of the screen by default, but maybe I am missing something.

Anyway supposedly this can be done by using the view:

findViewById(android.R.id.content)

However I get a warning that this may be null even though it always seems to work wherever I try it. When can it possibly be null?

adding a png file located in D drive folder charts file name webcharts.png

i am a basically a non technical person. gained experience in share trading expert. presently using amibroker platform for stock charting in my computer. i would like to export the real time charts to my web site. being a accounts back ground i don't know basic s of software programming languages java, java scripts etc. please help me. Advance thanks for Programmers who suggest me in this matter. how to save a file in jpg or png format. and how to add the file to my web site.

Name: Svum raju, Ph:9177523666, mail: vumrajusagi@gmail.com

JavaFX TableView: Select the whole TableColumn and get the index

Assume that we have a simple Tableview with 3 columns (A, B, C). Each Column contains some data which is not important at the moment.

I wondered if it would be possible to make only a whole column selectable (no matter where the user clicks in the column) and retrieve the ID and/or index of that column selected by the user?

For example, the user clicks somewhere in the area of column B. In that case the whole column should be marked and index 2 should be returned.

Any help would be appreciated ;)