Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Course Queries Syllabus Queries 2 years ago
Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I've an app for displaying my college syllabus where I display a bunch of html files stored as assets in an activity with a webview. The App supports only API 14+ The html files are plain text files. What I'm trying to do now is provide a share button which would copy the all the text in the webview and provide option to share it via the shareintent with the copied text as the body. I'm able to do this manually in the webview by long pressing on text and using select all button and copying it and then pasting it anywhere I want. This works perfectly. I just wanna replicate this action with the click of a button
Here's the code I tried :
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); KeyEvent shiftPressEvent = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_SHIFT_LEFT, 0, 0); shiftPressEvent.dispatch(webView); if(clipboard!=null) { String text = clipboard.getText().toString(); Toast.makeText(SyllabusPage_alternative.this, "select_text_now " + text, Toast.LENGTH_LONG).show(); Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); sharingIntent.setType("text/plain"); String shareBody = text; sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody); startActivity(Intent.createChooser(sharingIntent, "Share via")); }
But this doesn't seem to be working right, when I press the button only the previous contents of the clipboard are presented in the toast and the body of the shareIntent. I just wanna know how to do this, select the whole text and then copy it into a string programmatically? Or Please Tell me of any other way I can approach this
Thank you for all the responses in advance
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Course Queries 4 Answers
Course Queries 5 Answers
Course Queries 1 Answers
Course Queries 3 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.