PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, May 18, 2022

[FIXED] How can I copy(gettext) from 50% of the textview?

 May 18, 2022     android, copy, partial, textview     No comments   

Issue

Maybe this is too easy, but I can't find the solution..

For example I can copy from TextView1 with this basic code.

TextView2.setText(TextView1.getText);

I am trying to this;

How can I copy first 50% of the TextView1's text.

Thank you for helping.


Solution

Try this Use substring()

TextView2.setText(TextView1.getText().toString().substring(0,TextView1.getText().toString().length()/2));


Answered By - AskNilesh
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing